1

I am following the Authenticating Angular2 with Oidc-client and trying to implement the authentication part. Because the angular2 is using

{ provide: LocationStrategy, useClass: HashLocationStrategy }

my urls will change to for eg: http://localhost:4200/#/dashboard.

In the identityserver and also on the client side, i am using redirect_uri as

http://localhost:4200/dashboard

But after give username and password, the pages redirects to http://localhost:4200/#/id_token and considered as invalid route.

Can anyone help how to solve this when using hashlocationstrategy in angular application and how to configure the identityserver?

Thanks

Mukil Deepthi
  • 6,072
  • 13
  • 71
  • 156

1 Answers1

0

oidc-client library process signin response by finding the last hash delimiter in your url

https://github.com/IdentityModel/oidc-client-js/blob/c6d76a557626d67e3848b7858cc66787bc77928b/src/SigninResponse.js#L11

So your redirect should typically be configured like this, http://localhost:4200/#/RedirectRouteName#

${window.location.origin}${window.location.pathname}#/RedirectRouteName#

hashbytes
  • 769
  • 1
  • 8
  • 26