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://unpkg.com/@startinblox/oidc@latest"></script>
<sib-auth>
<sib-auth-provider
class="sib-auth-provider"
data-authority="https://test-paris.happy-dev.fr/openid/"
data-client_id="833925"
data-id="paris"
data-client-name="SIB App"
>
</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/3" 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();