@50000feet/oidc-slack-open-id-react 中文文档教程
OIDC React
About
React组件(AuthProvider)提供OpenID Connect和OAuth2协议支持。 有 hooks ????
基于 oidc-client-js。
Quickstart
通过运行安装包:
$ npm install oidc-react
Usage
...
import { AuthProvider } from 'oidc-react';
const oidcConfig = {
onSignIn: () => {
// Redirect?
},
authority: 'https://oidc.io/oauth',
clientId: 'this-is-a-client-id',
redirectUri: 'https://my-app.com/'
};
const Routes = () => (
<AuthProvider {...oidcConfig}>
<Switch>
<Route exact path="/">
<Dashboard />
</Route>
...
</Switch>
</AuthProvider>
);
Documentation
除了这个 README,您还可以在以下位置找到使用 SDK 的详细信息和示例:
Contribute & Disclaimer
We love to get help 在 CONTRIBUTING 中阅读有关如何开始的更多信息????
OIDC React
About
React component (AuthProvider) to provide OpenID Connect and OAuth2 protocol support. Has hooks ????
Based on oidc-client-js.
Quickstart
Install packages by running:
$ npm install oidc-react
Usage
...
import { AuthProvider } from 'oidc-react';
const oidcConfig = {
onSignIn: () => {
// Redirect?
},
authority: 'https://oidc.io/oauth',
clientId: 'this-is-a-client-id',
redirectUri: 'https://my-app.com/'
};
const Routes = () => (
<AuthProvider {...oidcConfig}>
<Switch>
<Route exact path="/">
<Dashboard />
</Route>
...
</Switch>
</AuthProvider>
);
Documentation
Apart from this README, you can find details and examples of using the SDK in the following places:
Contribute & Disclaimer
We love to get help ???? Read more about how to get started in CONTRIBUTING ????