damienbod / angular-auth-oidc-client

npm package for OpenID Connect, OAuth Code Flow with PKCE, Refresh tokens, Implicit Flow
https://www.npmjs.com/package/angular-auth-oidc-client
MIT License
1.11k stars 418 forks source link

[Question]: ResponseType code id_token token + implicitFlow in angular-auth-oidc-client": "^15.0.1" #1897

Open gauravshri-IBM opened 3 months ago

gauravshri-IBM commented 3 months ago

When use responseType: 'code id_token token' my aplication not redirecting me to login page, it says invalid responseType check config.

where as with responseType: 'id_token token' able to login and post login its not redirecting me to correct route page

Error in Console Error: authorizedCallback, token(s) validation failed, resetting. Hash:

correct url post login https://localhost:4200/lingwyztic/dashboard

presently going to incorrect url https://localhost:4200/lingwyztic/unauthorized

does 15.0.1 supports implicitFlow

RAMKI2 commented 2 months ago

could you please share your configurations? That helps more with the question

gauravshri-IBM commented 2 months ago

when i add code as well in response type then it says incorrect mapping so i am trying with id_token token, but here issue i have is my url with accestoken is keep on refreshing never settled kind of... Any help is appreciated Thanks.

const initializeAppFactory = (configService: ConfigurationService) => { const config$ = configService.getBaseConfig().pipe( map((customConfig: BaseConfig) => { console.log('Loaded custom configuration:', customConfig); const oidcConfig = { authority: customConfig.MID_issuer, loginUrl: customConfig.MID_loginUrl, tokenEndpoint: customConfig.MID_tokenEndpoint, userinfoEndpoint: customConfig.MID_userinfoEndpoint, clientId: customConfig.MID_clientId, redirectUrl: window.location.origin + '/arcistic/dashboard', postLogoutRedirectUri: window.location.origin, scope: 'openid profile email voucher offline_access', responseType: 'id_token token', silentRenew: true, renewTimeBeforeTokenExpiresInSeconds: 30, ignoreNonceAfterRefresh: true, // startCheckSession: true, silentRenewUrl: ${window.location.origin}/arcistic/silent-renew.html, logLevel: LogLevel.Debug, } console.log('OIDC Configuration:', oidcConfig); return oidcConfig; }) ); return new StsConfigHttpLoader(config$); };

Silent-renew html

<!DOCTYPE html>

silent-renew