@jfront/oauth-user
TypeScript icon, indicating that this package has built-in type declarations

0.2.5 • Public • Published

oauth-context

React Web implementation.

Usage

Simple usage in React SPA. Uses Authorization Code Grant with PKCE extension by default.

import React from "react"
import { OAuthWebContext, OAuthSecuredFragment } from "@jfront/oauth-ui"

function App() {
  return (
    <OAuthWebContext
      clientId={"243j24h246j242gjikh6kllnn5l"} //application client_id
      redirectUri={"http://localhost/app/oauth"} //library uses scheme:[//authority]/context_path/oauth url as default callback endpoint
      oauthContextPath={"http://localhost/oauth/api"} //oauth API base url
    >
      <OAuthSecuredFragment>
        <div>Logged in</div>
      </OAuthSecuredFragment>
    </OAuthWebContext>
  )
}

Readme

Keywords

none

Package Sidebar

Install

npm i @jfront/oauth-user

Weekly Downloads

3

Version

0.2.5

License

Apache-2.0

Unpacked Size

84.8 kB

Total Files

39

Last publish

Collaborators

  • botnet-unit-273
  • capcrs
  • alexanderlapygin
  • alexsav94
  • dmitrii92