From cc5b05e0acde957854d770aaf587876d07ddd7cf Mon Sep 17 00:00:00 2001 From: Denys Oblohin Date: Fri, 5 Feb 2021 21:06:33 +0200 Subject: [PATCH] chore: Use /login/callback instead of /implicit/callback OKTA-324375 <<>> Artifact: okta-angular --- README.md | 6 +++--- test/e2e/harness/src/app/app.module.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ff158c19..f118ab87 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ import { const oktaConfig = { issuer: 'https://{yourOktaDomain}.com/oauth2/default', clientId: '{clientId}', - redirectUri: window.location.origin + '/implicit/callback' + redirectUri: window.location.origin + '/login/callback' } @NgModule({ @@ -170,7 +170,7 @@ If a user does not have a valid session, then a new authorization flow will begi Used by the login redirect flow, begun by a call to [signInWithRedirect](https://github.com/okta/okta-auth-js#signinwithredirectoptions). This component handles the callback after the redirect. By default, it parses the tokens from the uri, stores them, then redirects to `/`. If a protected route (using [`OktaAuthGuard`](#oktaauthguard)) caused the redirect, then the callback will redirect back to the protected route. If an error is thrown while processing tokens, the component will display the error and not perform any redirect. This logic can be customized by copying the component to your own source tree and modified as needed. For example, you may want to capture or display errors differently or provide a helpful link for your users in case they encounter an error on the callback route. The most common error is the user does not have permission to access the application. In this case, they may be able to contact an administrator to obtain access. -You should define a route to handle the callback URL (`/implicit/callback` by default). Also add `OktaCallbackComponent` to the declarations section of in your `NgModule`. +You should define a route to handle the callback URL (`/login/callback` by default). Also add `OktaCallbackComponent` to the declarations section of in your `NgModule`. ```typescript // myApp.module.ts @@ -181,7 +181,7 @@ import { const appRoutes: Routes = [ { - path: 'implicit/callback', + path: 'login/callback', component: OktaCallbackComponent }, ... diff --git a/test/e2e/harness/src/app/app.module.ts b/test/e2e/harness/src/app/app.module.ts index d099ebae..04ea4464 100644 --- a/test/e2e/harness/src/app/app.module.ts +++ b/test/e2e/harness/src/app/app.module.ts @@ -54,7 +54,7 @@ const appRoutes: Routes = [ component: SessionTokenLoginComponent }, { - path: 'implicit/callback', + path: 'login/callback', component: OktaCallbackComponent }, { @@ -99,7 +99,7 @@ const appRoutes: Routes = [ // On the callback load we detect PKCE by inspecting the pathname const url = new URL(window.location.href); const pkce = !!url.searchParams.get('pkce') || url.pathname.indexOf('pkce/callback') >= 0; -const redirectUri = window.location.origin + (pkce ? '/pkce/callback' : '/implicit/callback'); +const redirectUri = window.location.origin + (pkce ? '/pkce/callback' : '/login/callback'); const config = { issuer: process.env.ISSUER,