1.0.3 • Published 4 years ago

react-routing-oidc v1.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

react-routing-oidc

OIDC Client with React Routing

NPM JavaScript Style Guide

Install

npm install --save react-routing-oidc

Usage

REACT_APP_AUTH_URL = 'https://identity.com'
REACT_APP_IDENTITY_CLIENT_ID = 'js2'
REACT_APP_REDIRECT_URL = 'http://localhost:5004/signin-callback.html'
REACT_APP_SILENT_REDIRECT_URL = 'http://localhost:5004/silent-callback';
REACT_APP_LOGOFF_REDIRECT_URL = 'https://identity.com/account/SignOut';
REACT_APP_REPONSE = 'id_token token'
import { AuthProvider } from 'react-routing-oidc'

const App = () => {
  return <AuthProvider>
    ...
  </AuthProvider>
}

export default App
import { Callback, Logout, LogoutCallback, SilentRenew } from 'react-routing-oidc';

<Route exact={true} path='/signin-callback.html' component={Callback}/>
<Route exact={true} path='/silent-callback.html' component={SilentRenew} />
<Route exact={true} path='/logout' component={Logout} />
<Route exact={true} path='/logout/callback' component={LogoutCallback} />

Put Routes to your

import { PrivateRoute } from 'react-routing-oidc';
<PrivateRoute path='/' component={HomePage} />

use PrivateRoute to check OIDC authentification

License

MIT © scor1on

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago