Socket
Socket
Sign inDemoInstall

angular-oauth2-oidc

Package Overview
Dependencies
Maintainers
1
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-oauth2-oidc

Support for OAuth 2 and OpenId Connect (OIDC) in Angular. Already prepared for the upcoming OAuth 2.1.


Version published
Weekly downloads
178K
increased by0.24%
Maintainers
1
Weekly downloads
 
Created

What is angular-oauth2-oidc?

The angular-oauth2-oidc package is an Angular library that provides support for OAuth 2 and OpenID Connect (OIDC) authentication. It allows developers to easily integrate secure authentication and authorization into their Angular applications.

What are angular-oauth2-oidc's main functionalities?

OAuth2 and OIDC Authentication

This feature allows you to configure and initiate OAuth2 and OIDC authentication in your Angular application. The code sample demonstrates how to set up the OAuthService with the necessary configuration and initiate the login process.

import { OAuthService, AuthConfig } from 'angular-oauth2-oidc';

const authConfig: AuthConfig = {
  issuer: 'https://your-identity-server',
  redirectUri: window.location.origin + '/index.html',
  clientId: 'your-client-id',
  scope: 'openid profile email',
  responseType: 'code'
};

oauthService.configure(authConfig);
oauthService.loadDiscoveryDocumentAndTryLogin();

Token Management

This feature provides methods to manage tokens, including retrieving access and ID tokens, and refreshing tokens. The code sample shows how to get the access token, ID token, and refresh the token using the OAuthService.

import { OAuthService } from 'angular-oauth2-oidc';

// Get access token
const accessToken = oauthService.getAccessToken();

// Get ID token
const idToken = oauthService.getIdToken();

// Refresh token
oauthService.refreshToken();

User Profile Information

This feature allows you to retrieve user profile information from the ID token. The code sample demonstrates how to get the identity claims and log them to the console.

import { OAuthService } from 'angular-oauth2-oidc';

// Get user profile information
const claims = oauthService.getIdentityClaims();
if (claims) {
  console.log(claims);
}

Other packages similar to angular-oauth2-oidc

FAQs

Package last updated on 27 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc