This terraform module creates an OpenID client on keycloak.
module "openid" {
source = "ballj/openid/keycloak"
version = "~> 1.0"
realm = "example.com"
client_id = "https://application.example.com"
name = "myapp"
access_type = "CONFIDENTIAL"
}
A list of roles can be provided:
module "openid" {
role = [
{
name = "admin",
description = "Admin role"
}
]
}
Client role mappers can be configured by passing a list to client_role_protocol_mappers.
The variables can be found in the TF openid_user_client_role_protocol_mapper.
module "openid" {
client_role_protocol_mappers = [
{
name = "user-role",
claim_name = "roles"
}
]
}
User property mappers can be configured by passing a list to user_property_protocol_mappers.
The variables can be found in the TF openid_user_property_protocol_mapper.
module "openid" {
user_property_protocol_mappers = [
{
name = "username"
user_property = "username"
claim_name = "preferred_username"
claim_value_type = "String"
},
{
name = "email"
user_property = "email"
claim_name = "email"
claim_value_type = "String"
},
{
name = "family name"
user_property = "lastName"
claim_name = "family_name"
claim_value_type = "String"
},
{
name = "given name"
user_property = "firstName"
claim_name = "given_name"
claim_value_type = "String"
}
]
}
User attribute mappers can be configured by passing a list to user_attribute_protocol_mappers.
The variables can be found in the TF openid_user_property_protocol_mapper.
module "openid" {
user_property_protocol_mappers = [
{
name = "car"
user_property = "car"
claim_name = "car"
claim_value_type = "String"
}
]
}
Full Name mappers can be configured by passing a list to full_name_protocol_mapper.
The variables can be found in the TF openid_full_name_protocol_mapper.
module "openid" {
full_name_protocol_mapper = {
name = "name"
}
}
Audience protocol mappers can be configured by passing a list to audience_protocol_mappers.
The variables can be found in the TF openid_audience_protocol_mapper.
module "openid" {
audience_protocol_mappers = [{
name = "client_id"
}]
}
