oidc-connect-pf
v1.1.18
Published
Gravitee login module, created with CRL
Downloads
12
Readme
oidc-connect-pf
Gravitee login module, created with CRL
Install
npm install --save oidc-connect-pf
Usage
import React, { Component } from 'react'
import { OIDCComponent } from 'oidc-connect-pf'
import 'oidc-connect-pf/dist/index.css'
const setUserToken = (resp) => {
console.log('USER TOKEN RECEIVED: ', resp)
}
class Example extends Component {
render() {
return <OIDCComponent
apphost="apphost"
customButton={logout_btn}
className={undefined}
userinfo={true}
devmode={process.env.REACT_APP_DEVMODE == 0 ? false : true}
devmode_data={{"user":"DEV-USER", "token":"dev_token_receive", "roles":"TAVIE_GESTION"}}
window={window}
graviteeserver={process.env.REACT_APP_GRAVITEE_HOST}
graviteedomaine="internal"
clientid={process.env.REACT_APP_GRAVITEE_ID}
redirecturl={`${process.env.REACT_APP_GRAVITEE_REDIRECT}`}
roles={[]}
bearer={process.env.REACT_APP_GRAVITEE_BASIC}
logoutcallback = {() => {console.log('Logout callback')}}
receivetokencallback = {(token) => {setUserToken(token)}}
/>
}
}
License
MIT Open source © [Thierry LOUREL](https://github.com/Thierry LOUREL)