Angular - Okta : how to use redirectUrl with useHash: true

Viewed 37

I'm using okta to authenticate my users in an angular 13 application. I've followed the okta article to use their sdk, but I'm stuck to define the redirectionUrl with HashLocationStrategy.

After login I'm getting a 404 error:

enter image description here

My code looks like :

package.json {
    ...
    "@okta/okta-angular": "^5.2.0",
    "@okta/okta-auth-js": "^6.8.0",
    ...
}

app.module.ts {
//...
const oktaAuth = new OktaAuth({
    issuer: 'https://dev-xxxxx.okta.com/oauth2/default',
    clientId: 'xxxxxxx',
    redirectUri: window.location.origin + '/login/callback',
    responseMode: 'query',
    pkce: true
});
//...
}

In okta, login section. I've this configuration : enter image description here

If I try to add a # in the redirectionUrl definition, I get the following message :

enter image description here

I've also added CORS rules :

enter image description here

Is there any way to use okta with useHash: true ?

2 Answers
Related