okta / okta-oidc-js

okta-oidc-js
https://github.com/okta/okta-oidc-js
Other
395 stars 232 forks source link

Login callback failed after redirect for HashLocationStrategy #746

Open lawchihon opened 4 years ago

lawchihon commented 4 years ago

I'm submitting this issue for the package(s):

I'm submitting a:

Current behavior

Got an internal error for Unable to parse a token from the url

Expected behavior

Login without error

Minimal reproduction of the problem with instructions

  1. Added useHash: true as options for RouterModule.forRoot
  2. Adde logic to redirect implicit/callback to #/implicit/callback when page load
  3. Call oktaAuth.loginRedirect

Extra information about the use case/user story you are trying to implement

Since the current Login redirect URIs cannot contain #, Im trying to redirect it back with # on customer side

Environment

swiftone commented 4 years ago

@lawchihon - Thanks for the report (and PR). We are thinking over how to handle this in all of our front end SDKs, not just angular, since anyone that returns to / after authentication will have issues - all hash-based routes will be on /, so we have to have a consistent way to know whether to look for tokens or not (and similarly, SOME / routes will require authentication)

Internal ref: OKTA-287878