1.8.4 • Published 4 years ago

generic-react-oauth2-pkce v1.8.4

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

react-oauth2-pkce

Authenticate against generic OAuth2 using PKCE

NPM JavaScript Style Guide

Install

npm install --save generic-react-oauth2-pkce

Usage

import React from 'react'
import { AuthProvider, AuthService } from 'generic-react-oauth2-pkce'

import { Routes } from './Routes';

const authService = new AuthService({
  clientId: process.env.REACT_APP_CLIENT_ID || 'CHANGEME',
  location: window.location,
  provider: process.env.REACT_APP_PROVIDER || 'https://sandbox.auth.ap-southeast-2.amazoncognito.com/oauth2',
  redirectUri: process.env.REACT_APP_REDIRECT_URI || window.location.origin,
  scopes: ['openid', 'profile'],

  // Optional Parameters
  // authorizeEndpoint
  // tokenEndpoint
  // audience
});

const App = () => {
  return (
    <AuthProvider authService={authService} >
      <Routes />
    </AuthProvider>
  )
}

export default App

gits

License

MIT © Gardner Bickford

1.8.4

4 years ago

1.8.3

4 years ago

1.8.2

4 years ago

1.8.1

4 years ago

1.8.0

4 years ago

1.6.0

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago