🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@bity/oauth2-auth-code-pkce

Package Overview
Dependencies
Maintainers
2
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bity/oauth2-auth-code-pkce

An OAuth 2.0 client that ONLY supports Authorization Code flow with PKCE support.

1.0.0
Source
npm
Version published
Maintainers
2
Created
Source

OAuth2AuthCodePKCE client

Installation

npm install @bity/oauth2-auth-code-pkce

Usage

Run npm run serve:examples and navigate to http://localhost:8080/examples/as-an-es6-browser-module.html

Modify the example to use the correct configuration.

TypeScript example

import { OAuth2AuthCodePKCE, Token } from './index';

OAuth2AuthCodePKCE
  .isComingBackFromAuthServer()
  .then((oauth: OAuth2AuthCodePKCE) => oauth.getAccessToken())
  .then((token: Token | undefined) => console.log(token))
  .catch((potentialError: string) => {
    if (potentialError) {
      alert(potentialError);
      return;
    }

    (new OAuth2AuthCodePKCE())
      .setConfig({
        authorizationUrl: 'https://localhost:8000/oauth2/auth',
        tokenUrl: 'https://localhost:8000/oauth2/token',
        clientId: 'f1e4ee59-d775-4314-b8bc-25e80c0b1ede',
        endpoints: ['http://localhost:4445'],
        scopes: ['offline'],
        redirectUrl: 'http://localhost:8080'
      })
      .fetchAuthorizationGrant();
  });

Keywords

oauth

FAQs

Package last updated on 18 Nov 2019

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