Azure AD with Angular 4 -


i'm using azure ad implicit flow angular 4 app. ng4 app using pathlocationstrategy routing can take advantage of clean urls. aad auth request looks this:

https://login.microsoftonline.com/xxxxx/oauth2/authorize?client_id=xxxx&response_type=id_token&redirect_uri=http://localhost:4200/login&response_mode=fragment&scope=openid&state=12345&nonce=xxxx

the authorization passes , i'm redirected http://localhost:4200/login#id_token=xxxxx gets redirected http://localhost:4200/home#id_token=xxxxx

i have routes looks this:

  { path: '', redirectto: 'home', pathmatch: 'full' },   {     path: '', component: blanklayoutcomponent,     children: [       { path: 'login#id_token=:id_token', component: logincomponent }     ]   },   {     path: '', component: basiclayoutcomponent,     children: [       { path: 'home', component: starterviewcomponent }     ]   },   // handle other routes   { path: '**', redirectto: 'home' } 

i can't seem route configured grab id_token url can use authorizing other requests. how can id_token redirection?

in component starterviewcomponent , implement interface oninit , write in method ngoninit.

export class starterviewcomponent implements oninit  {      ngoninit() {        if (window.location.hash) {             this.someloginservice.validatetoken(window.location.hash);         }     }  } 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -