0.0.1 • Published 9 months ago

oidc-auth-beta v0.0.1

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
9 months ago

unicc-oidc-auth

This library contains a component that implements a QR code authentication using UNICC OIDC Bridge.

Once the QR code is rendered on the screen, you should read it with your custom mobile app so the data can be shown.

If the timer expires before you are able to validate the QR code, it will get a new one automatically twice at most.

Installation

yarn add unicc-oidc-auth

or

npm install unicc-oidc-auth

Usage

Render a OidcAuth component supplying the mandatory props:

import { OidcAuth } from  "unicc-oidc-auth";
import "unicc-oidc-auth/dist/index.css";

(...)
<OidcAuth 
	appUrl={appUrl}
	oidcUrl={oidcUrl}
	oidcPresReqConfId={oidcPresReqConfId}
	oidcClientId={oidcClientId}
/>
(...)
PropDescriptionMandatory
appUrlClient app URL:white_check_mark:
oidcUrlOIDC Bridge URL:white_check_mark:
oidcPresReqConfIdOIDC Bridge Presentation Configuration ID:white_check_mark:
oidcClientIdOIDC Bridge Client ID:white_check_mark:
wrapperCustom wrapper function

Styling

In case you want to customize the QR code, the timer and/or the data shown, you can use wrapper prop, which signature and arguments are below:

const wrapper = (args: OidcAuthWrapperArgs) => JSX.Element
ArgTypeDescription
qrCodeJSX.ElementQR Code render
timeRemainingJSX.ElementTimer render
defaultAccountDataWrapperJSX.ElementDefault account data render
accountDataAccountDataAccount data object
isLoadingbooleanFlag that indicates if it's loading, either QR Code or data
hasErrorbooleanFlag that indicates whether there was an error

License

Apache 2.0

Copyright

Copyright 2023 United Nations International Computing Centre (www.unicc.org) This product includes software developed at UNICC.