4.2.0 • Published 1 year ago

@de-mklinger/react-oauth2-pkce v4.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

react-oauth2-pkce

Authenticate against generic OAuth2 using PKCE.

NPM

Install

npm install --save @de-mklinger/react-oauth2-pkce

Usage

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

import { Routes } from './Routes';

const authService = new AuthService({
  clientId: process.env.REACT_APP_CLIENT_ID || 'CHANGEME',
  provider: process.env.REACT_APP_PROVIDER || 'https://auth.example.com',
  redirectUri: process.env.REACT_APP_REDIRECT_URI || window.location.origin,
  scopes: ['openid', 'profile']
});

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

export default App

License

MIT

Based on the works of Gardner Bickford.

4.2.0

1 year ago

4.1.0

1 year ago

4.0.2

1 year ago

4.0.1

2 years ago

4.0.0

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago