🚀 Launch Week Day 5:Introducing Immutable Scans.Learn More →
Socket
Book a DemoInstallSign in
Socket

@hiro-graph/implicit-oauth

Package Overview
Dependencies
Maintainers
4
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@hiro-graph/implicit-oauth

Customisable Implicit Oauth

unpublished
latest
npmnpm
Version
6.0.2
Version published
Weekly downloads
0
Maintainers
4
Weekly downloads
 
Created
Source

@hiro-graph/implicit-oauth: Implicit OAuth flow helper

A simple oauth implicit flow, with options for a Popup or a Redirect based

installation

$ npm install @hiro-graph/implicit-oauth

Usage example


import { Popup } from "@hiro-graph/implicit-oauth"

const config = {
    url: "https://your/authorize/url...",
    clientId: "...yourClientId"
};

// Your login button
const loginButton = document.getElementById("loginButton")

const { check, request } = Popup(config);

const authCallback = (err, token) => {
    if (err) {
        //something bad happened :(
        console.warn(err);
    }
    if (token) {
        // User logged in successfully
        // access token at `token.accessToken`
        // metadata at `token.meta`
        document.write("Logged In: " + token.accessToken);
    }
});

//perform passive login check
check(authCallback);

// Trigger implicitOauth when clicked (open popup)
loginButton.addEventListener("click", () => request(authCallback));

FAQs

Package last updated on 15 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