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

0.4.0 • 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-ui

Weekly Downloads

0

Version

0.4.0

License

Apache-2.0

Unpacked Size

83.3 kB

Total Files

44

Last publish

Collaborators

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