Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
General documentation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anastasia Kryukova
General documentation
Commits
00f1ab18
Commit
00f1ab18
authored
4 years ago
by
Matthieu Fesselier
Browse files
Options
Downloads
Patches
Plain Diff
update solid-auth
parent
540caade
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/import_documentation/Components/Solid-Auth.rst
+51
-31
51 additions, 31 deletions
source/import_documentation/Components/Solid-Auth.rst
with
51 additions
and
31 deletions
source/import_documentation/Components/Solid-Auth.rst
+
51
−
31
View file @
00f1ab18
...
@@ -8,16 +8,15 @@ Installation
...
@@ -8,16 +8,15 @@ Installation
--------------
--------------
Initialize ``sib-auth`` in your HTML file:
Initialize ``sib-auth`` in your HTML file:
.. code:: html
.. code:: html
<script type="module" src="https://unpkg.com/@startinblox/oidc@latest"></script>
<script type="module" src="https://unpkg.com/@startinblox/oidc@latest"></script>
<sib-auth>
<sib-auth>
<sib-auth-provider
<sib-auth-provider
data-authority="https://test-paris.happy-dev.fr/openid/"
data-authority="https://test-paris.happy-dev.fr/openid/"
data-id="paris"
data-id="paris"
>
></sib-auth-provider>
</sib-auth-provider>
</sib-auth>
</sib-auth>
`You'll find here the detail of the attributes configuration. <https://github.com/IdentityModel/oidc-client-js/wiki#usermanager>`__
`You'll find here the detail of the attributes configuration. <https://github.com/IdentityModel/oidc-client-js/wiki#usermanager>`__
...
@@ -26,13 +25,14 @@ Set an OIDC provider to your server
...
@@ -26,13 +25,14 @@ Set an OIDC provider to your server
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Django package associated is there => https://github.com/jblemee/django-oidc-provider
The Django package associated is there => https://github.com/jblemee/django-oidc-provider
More documentation here => https://django-oidc-provider.readthedocs.io/en/latest/
More documentation here => https://django-oidc-provider.readthedocs.io/en/latest/
Don't forget to set up your RSA key:
Don't forget to set up your RSA key:
.. code:: bash
.. code:: bash
python3 ./manage.py creatersakey
python3 ./manage.py creatersakey
Setup your login button
Setup your login button
...
@@ -40,36 +40,56 @@ Setup your login button
...
@@ -40,36 +40,56 @@ Setup your login button
Here is an example to make you understand the logic:
Here is an example to make you understand the logic:
.. code:: html
.. code:: html
<button id="login">Login</button>
<button id="login">Login</button>
<!-- wherever you want in your interface -->
<!-- wherever you want in your interface -->
<script>
<script>
// wherever you want in your project
// wherever you want in your project
document.querySelector('#login').addEventListener('click', () => {
document.querySelector('#login').addEventListener('click', () => {
document.querySelector('sib-auth').login()
document.querySelector('sib-auth').login()
});
});
</script>
</script>
.. _bind-user:
Attributes
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:
.. code:: html
.. _bind-user:
``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:
.. code:: html
<sib-conversation bind-user></sib-conversation>
will result in:
.. code:: html
<sib-conversation data-src="https://your-domain/your-user-uri/3" bind-user></sib-conversation>
<sib-conversation bind-user></sib-conversation>
``auto-login``
~~~~~~~~~~~~~~
If set, ``auto-login`` will automatically redirect the user to the login page of his
provider if he's not authenticated yet.
will result in
:
Example
:
.. code:: html
.. code:: html
<sib-conversation data-src="https://your-domain/your-user-uri/3" bind-user></sib-conversation>
<sib-auth auto-login>
<sib-auth-provider
data-authority="https://test-paris.happy-dev.fr/openid/"
data-id="paris"
></sib-auth-provider>
</sib-auth>
Methods
available
Methods
------------------
------------------
``login``
``login``
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment