@50000feet/oidc-slack-open-id-react 中文文档教程

发布于 3年前 浏览 20 项目主页 更新于 3年前

OIDC React

代码风格:更漂亮代码风格:airbnbCommitizen friendlysemantic-release构建和部署

语言等级:JavaScriptcodecov Maintainability

oidc-react logo

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

code style: prettiercode style: airbnbCommitizen friendlysemantic-releaseBuild & Deploy

Language grade: JavaScriptcodecovMaintainability

oidc-react logo

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 ????

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文