bcgov / bcgov/common-web-utils
Applying arguments to override options for some methods in Implicit Auth Manager
- Dominant language
- JavaScript
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem? Please describe.**
I saw an example of the implicit auth manager where buttons to do redirects to the sso provider where based on different identity providers. This required (at this stage) for the config ssoIDPHint to be assigned on the fly.
```js
const { idp } = this.props.location.state;
if (idp) implicitAuthManager.config.kcIDPHint = idp;
return (window.location = implicitAuthManager.getSSOLoginURI());
```
Ofcourse we want to avoid doing this.
@shelly @jleach any thoughts on a good implementation of this?
I have a few ideas.
1. Register IDPs in the config on instantiation and then pass them as an argument into `getSSOLoginUri`
```js
const options = {
...
idps: {
github: 'foo',
idir: 'bar'
}
}
const iam = new ImplicitAuthManager(options);
iam.getSSOLoginUri('github')
```
2. Allow to pass overrides into a function call based on relevant option properties
```js
iam.getSSOLoginUri({kcIDPHint: 'idir'});
```
3. Allow specific arguments per function call
```js
iam.getSSOLoginURI('idir');
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.