-
Notifications
You must be signed in to change notification settings - Fork 0
SSOClient
Green_Lab edited this page Mar 10, 2022
·
2 revisions
class SSOClient
:
- constructor(options)
- async init()
- getRedirector()
- async fetch(req, codeVerifier)
new SSOClient(options)
options:
{
iserv: 'mein-iserv.de', // It is important to type the url like this without a slash at the end and no https:// in the beginning
clientId: 'YOUR CLIENT ID HERE',
clientSecret: 'YOUR CLIENT SECRET/GEHEIMNIS HERE',
redirectUri: 'http://localhost/openid-granted',
}
Returns a new SSOClient
await SSOClient.init()
Initializes the SSOClient. Need to be awaited.
SSOClient.getRedirector()
Returns a new codeVerifier which needs to be stored in a session or something familar and a redirectURI combined in an object:
{
codeverifier: 'CODEVERIFIER',
redirectUri: 'http://localhost/openid-granted'
}
await SSOClient.fetch(req, codeVerifier)
Returns a new User. Needs to be awaited. Expects the request from the WebServer or express and the codeVerifier which was returned by getRedirector