IAM and identity providers
An IAM project is an authentication service: it signs users in and issues them a token (a JWT). It can rely on:
- Grizzly's default identity provider: users sign up and sign in with a username and password, stored in a database;
- your identity providers: Keycloak, Google, GitHub, GitLab, Facebook or LinkedIn.
Add an identity provider
In the left menu, click Identity Providers. The Identity Providers page lists your providers.
- Click Add New Identity Provider (or Add provider if you don't have any yet).
- At the Select your Identity Provider step, click a card: Keycloak, Google, Github, Gitlab, Facebook or Linkedin. Click Next.
- At the Fill connection step, fill in the fields (see below), then click Next.
- At the Review Connection step, check the information and click Create Identity Provider.
The Name must be unique among your providers: otherwise, an error message is shown and the provider isn't created.
Google, GitHub, GitLab, Facebook and LinkedIn
Just fill in a Name (required) and a Description. The Protocol is set to OpenId Connect.
Keycloak
| Field | What to enter |
|---|---|
| Name | The provider's display name (required) |
| Description | Optional |
| Username and Password | A user account in your Keycloak realm, used to test the connection |
| Client ID | The ID of the client declared in Keycloak |
| Access Type | Confidential or Public, as in the Keycloak client configuration |
| Secret Key | The client secret (only with the Confidential access type) |
| Grant Type | Password, or Client Credentials (only with the Confidential access type) |
| Issuer (url) | The realm address, for example https://keycloak.example.com/realms/my-realm |
Then click Test Connection. The Next button only works once the message "Connection Succeeded !" is shown.
Edit or delete a provider
On the provider's card, click ⋮, then Edit or Delete. Deleting asks for confirmation.
Create an IAM project
- Open Projects, click New Microservice, then choose IAM.
- Fill in the Project Name and the Description.
- Choose how users sign in:
- select Continue with a default Identity Provider to use Grizzly's provider. The wizard then asks for a data source, where users will be stored;
- otherwise, at the Select Identity Provider step, pick one or more providers in Choose an Identity Provider. The Add button creates one without leaving the wizard.
- At the Review step, click Validate.
The wizard is detailed in Create a project.
An IAM project's page
The endpoints of an IAM project are created by Grizzly and can't be changed. Their access roles are shown read-only.
| Mode | Group created | Main endpoints |
|---|---|---|
| Default provider | Authentication Grizzly | POST /signin, POST /signup, user management |
| Your providers | Authentication Oauth | GET /authorization, GET /userinfo |
The Security section offers the Token Configuration tab, for viewing only, and the Manage Roles tab (see Secure an API). With the default provider, the API Keys tab and the Security Documentation block, with call examples ready to copy, are added.
Sign end users in
The examples use the IAM project's Runtime URL.
With the default provider
Users sign up with POST /signup and sign in with POST /signin, as described in Secure an API.
With Keycloak
Call GET /authorization with the username, the password and the provider:
curl "https://<runtime-url>/authorization?username=mary&password=myPassword&identityProvider=KEYCLOAK"The response contains the token: {"token": "..."}.
With Google, GitHub, GitLab, Facebook or LinkedIn
From your application, redirect the user's browser to:
https://<runtime-url>/authorization?identityProvider=google&redirect_uri=https://my-app.example.com/loginReplace google with github, gitlab, facebook or linkedin depending on the provider. The user signs in with the provider, then comes back to your redirect_uri with the token in the address: ?token=.... Read it there and send it to the API afterwards.
INFO
The requested provider must be one of the IAM project's providers. Otherwise, the API responds Your identity provider doesn't exist on this microservice !.
What's next?
- Protect your endpoints by role: Secure an API.
- Share a project and its identity providers with your teams: Test, export and share.
- Manage your teams: Organization.
