Gathering detailed insights and metrics for @vinayg/angular-auth-oidc-client
Gathering detailed insights and metrics for @vinayg/angular-auth-oidc-client
Gathering detailed insights and metrics for @vinayg/angular-auth-oidc-client
Gathering detailed insights and metrics for @vinayg/angular-auth-oidc-client
npm package for OpenID Connect, OAuth Code Flow with PKCE, Refresh tokens, Implicit Flow
npm install @vinayg/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
12.0.3
Package Id
@vinayg/angular-auth-oidc-client@12.0.3
Unpacked Size
2.43 MB
Size
473.31 kB
File Count
241
NPM Version
6.14.11
Node Version
14.16.0
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
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.
ng 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 } from '@angular/core'; 2import { OidcSecurityService } from 'angular-auth-oidc-client'; 3 4@Component({ 5 /*...*/ 6}) 7export class AppComponent implements OnInit { 8 constructor(public oidcSecurityService: OidcSecurityService) {} 9 10 ngOnInit() { 11 this.oidcSecurityService.checkAuth().subscribe(({ isAuthenticated, userData, accessToken, idToken }) => { 12 /*...*/ 13 }); 14 } 15 16 login() { 17 this.oidcSecurityService.authorize(); 18 } 19 20 logout() { 21 this.oidcSecurityService.logoff(); 22 } 23}
You can get the access token by calling the method getAccessToken()
on the OidcSecurityService
1const token = this.oidcSecurityService.getAccessToken();
And then you can use it in the HttpHeaders
1import { HttpHeaders } from '@angular/common/http'; 2 3const token = this.oidcSecurityServices.getAccessToken(); 4 5const httpOptions = { 6 headers: new HttpHeaders({ 7 Authorization: 'Bearer ' + token, 8 }), 9};
Current Version is Version 12.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