Implement OIDC authorization code grant flow for AngularJS SPA

221 views Asked by At

I have an AngularJS application. I want to implement OIDC Authorization Code Grant flow.

I first tried with the 'Okta Auth JavaScript SDK' library to integrate my application with Okta, and the integration was successful. Now, I need to implement authentication for other providers like ForgeRock and Azure AD. I'm seeking a generic library compatible with AngularJS, incorporating modern security best practices such as the PKCE extension. Could someone please assist me in finding such a library?

1

There are 1 answers

2
Daredevil On

Few I have used in past:

  1. oidc-client-ts:

    • A low-level, library for handling OpenID Connect and OAuth2. It works well with any client-side framework.
    • Provides a lot of flexibility and supports PKCE.
    • You can configure it to work with any OIDC-compliant identity provider.
    • Since it's low-level, you might have to handle some of the UI aspects and other integrations yourself.
    • Github Repository
  2. Angular-oauth2-oidc:

    • Tailored for Angular (though primarily newer versions, not AngularJS).
    • Makes it easy to connect any OIDC compliant authorization server.
    • Supports PKCE.
    • Depending on your AngularJS version, you might need to make a few adjustments, or consider moving to a newer Angular version.
    • Github Repository