aurelia-contrib / aurelia-open-id-connect

An aurelia adapter for the IdentityModel/oidc-client-js
https://zamboni-app.azurewebsites.net
MIT License
54 stars 18 forks source link

two factor auth for some modules in same Aurelia application #58

Closed sreddim closed 5 years ago

sreddim commented 6 years ago

Hi , I am building an application that requires two-factor authentication on some of the navigation modules.

profile, license, admin are the modules listed on navigation menu.

Profile and ViewLicense require normal authentication which is already working. Only For Admin module I want to enable 2fa ( two factor authentication). With this property acr_values: "XXXX" on open-id-connnect-config it is always asking for 2fc check on all modules Profile , License and Admin.

How can I let the app know only to use acr_values property for admin module but not for other modules.

Can I achieve this with 2 open-id-config files in the same application? In that case how does my main.ts should register them and what changes should I do it when checking for Authentication in pipe line step
where I do await this.openIdConnect.userManager.getUser();

Thank you, Salini

koenbeuk commented 5 years ago

@sreddim Late to the game, but here it goes:

When calling userManager.login(...) you can specify parameters. One way to make a call with custom acr_values (custom from whats configured in your config), try: userManager.login({ data: { acr_values: ... } }.

See the createSigninRequest method on https://github.com/IdentityModel/oidc-client-js/blob/dev/src/OidcClient.js for all parameter that can be configured using this method.

arnederuwe commented 5 years ago

Hi, I will be closing up stale issues by the end of the week.

Are you still experiencing this issue? Feel free to close this yourself. If you are still experiencing this issue, let me know as well, thanks!