GithubHelp home page GithubHelp logo

altenfreelance / react-oauth2-pkce Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gardner/react-oauth2-pkce

0.0 1.0 0.0 4 MB

React auth provider that works with AWS cognito PKCE🛡️🔒

HTML 9.71% JavaScript 0.98% CSS 2.27% TypeScript 87.05%

react-oauth2-pkce's Introduction

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

react-oauth2-pkce's People

Contributors

gardner avatar altenfreelance avatar t-knapp avatar thespivack avatar nitescuc avatar jozefbabala avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.