@startinblox/oidc
v0.16.5
Published
Allows your users to login via a given OIDC provider.
Downloads
22
Keywords
Readme
SIB OIDC
Allows your users to login via a given OIDC provider.
Installation
Add the following within the <head>
of your HTML:
<script type="module" src="https://cdn.skypack.dev/@startinblox/oidc@beta/dist/index.js"></script>
<sib-auth>
<sib-auth-provider
data-authority="https://api.community.startinblox.com"
data-id="sib"
data-client-name="Hubl SIB"
></sib-auth-provider>
</sib-auth>
Documentation
bind-user
To associate the currently logged in user to a component, add the bind-user
attribute to it.
It will set its `data-src' attribute to the currently logged in user's resource URL.
Example:
<sib-conversation
bind-user
></sib-conversation>
will result in :
<sib-conversation
data-src="https://your-domain/your-user-uri"
bind-user
></sib-conversation>
Methods available
Login
document.querySelector('sib-auth').login();
Logout
document.querySelector('sib-auth').logout();
Get user info
document.querySelector('sib-auth').getUser();