Keycloak Quickstart Guide
Keycloak is an open source Identity and Access Management solution aimed at modern applications and services, this document covers configuring Keycloak identity provider support with MinIO.Prerequisites
Configure and install keycloak server by following Keycloak Installation Guide (finish upto section 3.4)Configure Keycloak UI
-
Go to Clients
- Click on account
- Settings
- Enable
Implicit Flow - Save
-
Go to Users
- Click on the user
- Attribute, add a new attribute
Keyispolicy,Valueis name of thepolicyon MinIO (ex:readwrite) - Add and Save
-
Go to Clients
- Click on
account - Settings, set
Valid Redirect URIsto*, expandAdvanced Settingsand setAccess Token Lifespanto1 Hours - Save
- Click on
-
Go to Clients
- Client on
account - Mappers
- Create
Namewith any textMapper TypeisUser AttributeUser AttributeispolicyToken Claim NameispolicyClaim JSON Typeisstring
- Save
- Client on
-
Open http://localhost:8080/auth/realms/minio/.well-known/openid-configuration to verify OpenID discovery document, verify it has
authorization_endpointandjwks_uri
Configure MinIO
identity_openid config with config_url, client_id and restart MinIO
NOTE: You can configure theOnce successfully set restart the MinIO instance.scopesparameter to restrict the OpenID scopes requested by minio to the IdP, for example,"openid,policy_role_attribute", beingpolicy_role_attributea client_scope / client_mapper that maps a role attribute called policy to apolicyclaim returned by Keycloak
Using WebIdentiy API
Client ID can be found by clicking any of the clients listed here. If you have followed the above steps docs, the default Client ID will beaccount.
NOTE: You can use theThese credentials can now be used to perform MinIO API operations.-cscopesparameter to restrict the requested scopes, for example to"openid,policy_role_attribute", beingpolicy_role_attributea client_scope / client_mapper that maps a role attribute called policy to apolicyclaim returned by Keycloak.
Using MinIO Browser
- Open MinIO URL on the browser, lets say http://localhost:9000
- Click on
Log in with OpenID - Provide
Client IDand press ENTER, ifclient_idis already configured for MinIO this page will automatically redirect to Keycloak user login page. - User will be redirected to the Keycloak user login page, upon successful login the user will be redirected to MinIO page and logged in automatically, the user should see now the buckets and objects they have access to.
