Gathering detailed insights and metrics for angular-auth-oidc-client
Gathering detailed insights and metrics for angular-auth-oidc-client
Gathering detailed insights and metrics for angular-auth-oidc-client
Gathering detailed insights and metrics for angular-auth-oidc-client
angular-auth-oidc-client-pramod
Angular Lib for OpenID Connect & OAuth2
integrator-angular-auth-oidc-client
An OpenID Connect Code Flow with PKCE,Implicit Flow client for Angular. Adapted for Integrator
@vinayg/angular-auth-oidc-client
Angular Lib for OpenID Connect & OAuth2
angular-auth-oidc-client-pema
[](https://travis-ci.org/damienbod/angular-auth-oidc-client) [](https://www.npmjs.com/package/angul
npm package for OpenID Connect, OAuth Code Flow with PKCE, Refresh tokens, Implicit Flow
npm install angular-auth-oidc-client
Typescript
Module System
Node Version
NPM Version
TypeScript (87.04%)
JavaScript (10.1%)
HTML (2.58%)
CSS (0.28%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
1,199 Stars
4,258 Commits
448 Forks
37 Watchers
11 Branches
92 Contributors
Updated on Jul 08, 2025
Latest Version
19.0.1
Package Id
angular-auth-oidc-client@19.0.1
Unpacked Size
973.10 kB
Size
158.89 kB
File Count
168
NPM Version
10.5.0
Node Version
20.11.1
Published on
May 11, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
4
Secure your Angular app using the latest standards for OpenID Connect & OAuth2. Provides support for token refresh, all modern OIDC Identity Providers and more.
This library is certified by OpenID Foundation. (RP Implicit and Config RP)
ng add
supportYou can use the schematics and ng add
the library.
1ng add angular-auth-oidc-client
And answer the questions. A module will be created which encapsulates your configuration.
Navigate to the level of your package.json
and type
1 npm install angular-auth-oidc-client
or with yarn
1 yarn add angular-auth-oidc-client
For the example of the Code Flow. For further examples please check the Samples Section.
If you have done the installation with the schematics, these modules and files should be available already!
Import the AuthModule
in your module.
1import { NgModule } from '@angular/core';
2import { AuthModule, LogLevel } from 'angular-auth-oidc-client';
3// ...
4
5@NgModule({
6 // ...
7 imports: [
8 // ...
9 AuthModule.forRoot({
10 config: {
11 authority: '<your authority address here>',
12 redirectUrl: window.location.origin,
13 postLogoutRedirectUri: window.location.origin,
14 clientId: '<your clientId>',
15 scope: 'openid profile email offline_access',
16 responseType: 'code',
17 silentRenew: true,
18 useRefreshToken: true,
19 logLevel: LogLevel.Debug,
20 },
21 }),
22 ],
23 // ...
24})
25export class AppModule {}
And call the method checkAuth()
from your app.component.ts
. The method checkAuth()
is needed to process the redirect from your Security Token Service and set the correct states. This method must be used to ensure the correct functioning of the library.
1import { Component, OnInit, inject } from '@angular/core'; 2import { OidcSecurityService } from 'angular-auth-oidc-client'; 3 4@Component({ 5 /*...*/ 6}) 7export class AppComponent implements OnInit { 8 private readonly oidcSecurityService = inject(OidcSecurityService); 9 10 ngOnInit() { 11 this.oidcSecurityService 12 .checkAuth() 13 .subscribe((loginResponse: LoginResponse) => { 14 const { isAuthenticated, userData, accessToken, idToken, configId } = 15 loginResponse; 16 17 /*...*/ 18 }); 19 } 20 21 login() { 22 this.oidcSecurityService.authorize(); 23 } 24 25 logout() { 26 this.oidcSecurityService 27 .logoff() 28 .subscribe((result) => console.log(result)); 29 } 30}
You can get the access token by calling the method getAccessToken()
on the OidcSecurityService
1const token = this.oidcSecurityService.getAccessToken().subscribe(...);
And then you can use it in the HttpHeaders
1import { HttpHeaders } from '@angular/common/http'; 2 3const token = this.oidcSecurityServices.getAccessToken().subscribe((token) => { 4 const httpOptions = { 5 headers: new HttpHeaders({ 6 Authorization: 'Bearer ' + token, 7 }), 8 }; 9});
You can use the built in interceptor to add the accesstokens to your request
1AuthModule.forRoot({
2 config: {
3 // ...
4 secureRoutes: ['https://my-secure-url.com/', 'https://my-second-secure-url.com/'],
5 },
6}),
1 providers: [ 2 { provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true }, 3 ],
Current Version is Version 19.x
No vulnerabilities found.
Reason
security policy file detected
Details
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
no binaries found in the repo
Reason
5 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 5
Reason
Found 8/14 approved changesets -- score normalized to 5
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
40 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More