Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jfront/oauth-core

Package Overview
Dependencies
Maintainers
5
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jfront/oauth-core

Core functionality for OAuth 2.0 connection.

  • 0.2.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
5
Weekly downloads
 
Created
Source

oauth-core

Core functionality for OAuth 2.0 connection.

Usage

import { OAuth } from "@jfront/oauth-core"

const oauth = new OAuth(
  "clientId",
  "http://localhost/app/oauth",
  "http://localhost/authorize",
  "http://localhost/token",
  "http://localhost/logout",
  window.sessionStorage,
)

API

authorize

Authorization Code/Implicit flow authorization.

oauth.authorize("code", "http://localhost/app/view")

getTokenWithAuthCode

Get token with authorization code, when authorization step was completed.

oauth.getTokenWithAuthCode("authorization_code", "random_nonce_string")

refreshToken

Refresh access token, if you have refresh_token.

oauth.refreshToken("refresh_token")

getTokenWithUserCredentials

Get token with user login/password.

oauth.getTokenWithUserCredentials("login", "password")

logout

Logout for client-side apps.

oauth.getTokenWithUserCredentials("http://localhost/app/view")

FAQs

Package last updated on 29 Dec 2022

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