Skip to content

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.

  1. Click Add New Identity Provider (or Add provider if you don't have any yet).
  2. At the Select your Identity Provider step, click a card: Keycloak, Google, Github, Gitlab, Facebook or Linkedin. Click Next.
  3. At the Fill connection step, fill in the fields (see below), then click Next.
  4. 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 ​

FieldWhat to enter
NameThe provider's display name (required)
DescriptionOptional
Username and PasswordA user account in your Keycloak realm, used to test the connection
Client IDThe ID of the client declared in Keycloak
Access TypeConfidential or Public, as in the Keycloak client configuration
Secret KeyThe client secret (only with the Confidential access type)
Grant TypePassword, 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 ​

  1. Open Projects, click New Microservice, then choose IAM.
  2. Fill in the Project Name and the Description.
  3. 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.
  4. 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.

ModeGroup createdMain endpoints
Default providerAuthentication GrizzlyPOST /signin, POST /signup, user management
Your providersAuthentication OauthGET /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:

bash
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:

text
https://<runtime-url>/authorization?identityProvider=google&redirect_uri=https://my-app.example.com/login

Replace 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? ​

Grizzly API · CodeOnce Software