Socket
Socket
Sign inDemoInstall

@8base/web-oauth-client

Package Overview
Dependencies
2
Maintainers
6
Versions
45
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@8base/web-oauth-client

The 8base web oauth client for the `AuthProvider`.


Version published
Weekly downloads
1.1K
increased by13.62%
Maintainers
6
Install size
13.8 MB
Created
Weekly downloads
 

Readme

Source

8base api token auth client

The 8base web oauth client for the AuthProvider.

WebOAuthClient

Table of Contents
  • WebOAuthClient

WebOAuthClient

Create instance of the web oauth client

Parameters
  • authorize Function Function used to describe authorize logic.

Usage

Firebase oauth

import firebase from 'firebase';
import { WebOAuthClient } from '@8base/web-oauth-client';

const FIREBASE_CONFIGURATION = {
  apiKey: "",
  authDomain: "",
  databaseURL: "",
  projectId: "",
  storageBucket: "",
  messagingSenderId: "",
  appId: ""
};

const firebaseAuth = firebase.initializeApp(FIREBASE_CONFIGURATION).auth();

const authClient = new WebOAuthClient({
  authorize (email, password) {
    return firebaseAuth.signInWithEmailAndPassword(
      email,
      password,
    )
      .then(() => firebaseAuth.currentUser.getIdToken())
      .then((token) => {
        return token;
      })
    },
  logout() {
    window.addEventListener('unload', () => {
      this.purgeState();
    });

    window.location.href = '/';
  }
});

Examples

Firebase oauth example
IBM cloud oauth example

FAQs

Last updated on 22 Mar 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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc