Skip to content

Commit

Permalink
Fix OIDC looping issue - too many redriects (#1014) (#1018)
Browse files Browse the repository at this point in the history
Signed-off-by: Aozixuan Priscilla Guan <[email protected]>
(cherry picked from commit 015dc3f)

Co-authored-by: Aozixuan Priscilla Guan <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] and aoguan1990 authored Jun 27, 2022
1 parent 2911722 commit 521d8a5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions server/auth/types/openid/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,11 @@ export class OpenIdAuthRoutes {
});
} catch (error) {
context.security_plugin.logger.error(`OpenId authentication failed: ${error}`);
// redirect to login
return this.redirectToLogin(request, response);
if (error.toString().toLowerCase().includes('authentication exception')) {
return response.unauthorized();
} else {
return this.redirectToLogin(request, response);
}
}
}
);
Expand Down

0 comments on commit 521d8a5

Please sign in to comment.