diff --git a/pages/hosted_private_cloud/opcp/how-to-use-api-and-get-credentials/guide.fr-fr.md b/pages/hosted_private_cloud/opcp/how-to-use-api-and-get-credentials/guide.fr-fr.md new file mode 100644 index 00000000000..f376df261e9 --- /dev/null +++ b/pages/hosted_private_cloud/opcp/how-to-use-api-and-get-credentials/guide.fr-fr.md @@ -0,0 +1,196 @@ +--- +title: "OPCP - Comment utiliser les API et obtenir les informations d'identification" +excerpt: "Découvrez les étapes nécessaires pour configurer Keycloak et le CLI OpenStack afin de permettre l’authentification via Keycloak" +updated: 2025-11-07 +--- + +## Objectif + +**OPCP** intègre une authentification centralisée avec **Keycloak**. Il est donc nécessaire de configurer la **CLI OpenStack** afin qu’il utilise Keycloak comme fournisseur d’identité (Identity Provider). + +**Ce guide décrit les étapes nécessaires pour configurer **Keycloak** et la **CLI OpenStack** afin de permettre l’authentification via Keycloak.** + +## Prérequis + +- Être administrateur de l'infrastructure [OPCP](/links/hosted-private-cloud/onprem-cloud-platform) et avoir accès à l'interface d'administration (admin.dashboard). +- Avoir accès à l'interface d'administration Keyloack admin. +- Avoir un utilisateur avec les droits suffisants pour se connecter à [Horizon](https://horizon.cloud.ovh.net/auth/login/) sur l'offre OPCP. + +## En pratique + +### Création d’un client Keycloak pour la CLI OpenStack + +Un client **Keycloak dédié** est nécessaire pour permettre à la CLI OpenStack de communiquer de manière sécurisée avec le serveur Keycloak. + +#### Étapes + +1. **Connexion à l’interface d’administration Keycloak** + Connectez-vous à votre instance Keycloak et sélectionnez le *realm* dans lequel les utilisateurs OpenStack sont définis. + +2. **Création d’un nouveau client** + - Allez dans la section `Clients` et cliquez sur `Créer un client`{.action}. + - Renseignez un **Client ID**, par exemple : + + ```text + openstack-cli + ``` + + - Cliquez sur `Suivant`{.action}. + +3. **Activation de l’authentification du client** + - Activez le **Client Authentication** (mettre sur **ON**). + - Cliquez sur `Suivant`{.action}, puis sur `Enregistrer`{.action}. + +4. **Configuration des portées (Client Scopes)** + - Ouvrez l’onglet `Client Scopes`. + - Sélectionnez la portée nommée : + + ```text + [votre-client-id]-dedicated + ``` + + - Cliquez sur `Configurer un nouveau mapper`{.action}. + +5. **Ajout d’un mapper d’attributs de groupe utilisateur** + - Choisissez le type de mapper **aggregated-user-group-attribute-mapper**. + - Configurez les champs suivants : + + | Champ | Valeur | + |--------|--------| + | **Name** | `projects` | + | **User Attribute** | `project` | + | **Token Claim Name** | `projects` | + + - Cliquez sur `Enregistrer`{.action}. + +6. **Récupération des identifiants du client** + - Allez dans l’onglet `Credentials` du client que vous venez de créer. + - Copiez et conservez de manière sécurisée la **Client Secret** — il sera nécessaire lors de la configuration du CLI OpenStack. + +--- + +### Configuration de la CLI OpenStack + +Une fois le client Keycloak créé, la CLI OpenStack doit être configurée pour utiliser ce client comme fournisseur d'identité OIDC (OpenID Connect). + +#### Étapes + +1. **Installer les outils CLI OpenStack** + Si ce n’est pas déjà fait : + + ```bash + sudo pip install python-openstackclient + ``` + +2. **Définir les variables d’environnement pour l’authentification Keycloak** + Exemple : + + ```bash + export OS_INTERFACE=public + export OS_IDENTITY_API_VERSION=3 + export OS_AUTH_URL="https://keystone.domain.ovh" + export OS_AUTH_TYPE="v3oidcpassword" + export OS_PROTOCOL="openid" + export OS_IDENTITY_PROVIDER="keycloak-admin" + export OS_CLIENT_ID="keycloak-client-id" + export OS_CLIENT_SECRET="keycloak-client-credentials" + export OS_DISCOVERY_ENDPOINT="https://admin.keycloak.domain.ovh/realms/master/.well-known/openid-configuration" + export OS_USERNAME="keycloak-user-username" + export OS_PASSWORD="keycloak-user-password" + export OS_PROJECT_ID="project-id" + ``` + + > **Tips 1** + > : Vous pouvez utiliser le script suivant afin de générer le fichier de configuration openrc.sh facilement : + + ```bash + #!/usr/bin/env bash + + read -p "Your environment's base FQDN (e.g. example.bmp.ovhgoldorack.ovh): " FQDN_ENV + + read -p 'master or pod realm ? (master/pod): ' REALM + if [ "$REALM" != "master" ] && [ "$REALM" != "pod" ]; then + echo "Invalid input. Please enter either 'master' or 'pod'." + exit 1 + fi + + read -p 'Keycloak client ID: ' KC_CLIENT_ID + read -srp 'Keycloak client secret: ' KC_CLIENT_SECRET && echo + + read -p 'Keycloak username: ' KC_USERNAME_INPUT + read -srp 'Keycloak password: ' KC_PASSWORD_INPUT && echo + + read -p 'Openstack Project ID (not the name): ' PROJECT_ID + + printf "\n\nHere is your configuration, paste it to your shell or use the generate openrc.sh file\n\n" + cat << EOM + export OS_INTERFACE=public + export OS_IDENTITY_API_VERSION=3 + export OS_AUTH_URL="https://keystone.${FQDN_ENV}" + export OS_AUTH_TYPE="v3oidcpassword" + export OS_PROTOCOL="openid" + export OS_IDENTITY_PROVIDER=$([ "$REALM" = "master" ] && echo "keycloak-admin" || echo "keycloak") + export OS_CLIENT_ID="$KC_CLIENT_ID" + export OS_CLIENT_SECRET="$KC_CLIENT_SECRET" + export OS_DISCOVERY_ENDPOINT="https://$([ "$REALM" = "master" ] && echo "admin.keycloak" || echo "keycloak").${FQDN_ENV}/realms/$REALM/.well-known/openid-configuration" + export OS_USERNAME="$KC_USERNAME_INPUT" + export OS_PASSWORD="$KC_PASSWORD_INPUT" + export OS_PROJECT_ID="$PROJECT_ID" + EOM + + echo "#!/usr/bin/env bash + + export OS_INTERFACE=public + export OS_IDENTITY_API_VERSION=3 + export OS_AUTH_URL="https://keystone.${FQDN_ENV}" + export OS_AUTH_TYPE="v3oidcpassword" + export OS_PROTOCOL="openid" + export OS_IDENTITY_PROVIDER=$([ "$REALM" = "master" ] && echo "keycloak-admin" || echo "keycloak") + export OS_CLIENT_ID="$KC_CLIENT_ID" + export OS_CLIENT_SECRET="$KC_CLIENT_SECRET" + export OS_DISCOVERY_ENDPOINT="https://$([ "$REALM" = "master" ] && echo "admin.keycloak" || echo "keycloak").${FQDN_ENV}/realms/$REALM/.well-known/openid-configuration" + export OS_USERNAME="$KC_USERNAME_INPUT" + export OS_PASSWORD="$KC_PASSWORD_INPUT" + export OS_PROJECT_ID="$PROJECT_ID > $PROJECT_ID."-openrc.sh" + ``` + + > **Tips: Configuration d'un proxy** + > Si vous utilisez un proxy pour accéder a votre service, vous devez configurer vos variables d'environnement pour prendre en compte ce proxy. + Pour ce faire, ajoutez les lignes de commande suivantes : + + ```bash + export https_proxy=http://your-adress-ip:port/ + export http_proxy=http://your-adress-ip:port/ + ``` + +### Vérification de la configuration + +Vous pouvez tester votre configuration à l’aide de quelques commandes simples : + +```bash +openstack token issue +openstack project list +openstack server list +``` + +Si ces commandes retournent des résultats, l’intégration **Keycloak ↔ OpenStack** est correctement configurée. + +--- + +### Dépannage (Troubleshooting) + +| Problème | Cause possible | Solution | +|-----------|----------------|-----------| +| `Invalid client credentials` | Mauvais ou manquant `Client Secret` | Vérifiez le secret dans l’onglet **Credentials** du client Keycloak | +| `Unauthorized` | L’utilisateur n’est pas associé au bon groupe ou projet | Vérifiez les attributs `project` de l’utilisateur dans Keycloak | +| `OIDC discovery failed` | Mauvaise URL dans `DISCOVERY_ENDPOINT` | Assurez-vous qu’elle pointe bien vers le *realm* correct de Keycloak | + +--- + +### Références + +- [Documentation Keycloak – OpenID Connect](https://www.keycloak.org/docs/latest/server_admin/#_oidc) +- [Documentation OpenStack Keystone](https://docs.openstack.org/keystone/latest/) +- [Documentation OVHcloud OPCP](https://docs.opcp.ovh) + +--- diff --git a/pages/hosted_private_cloud/opcp/how-to-use-api-and-get-credentials/meta.yaml b/pages/hosted_private_cloud/opcp/how-to-use-api-and-get-credentials/meta.yaml new file mode 100644 index 00000000000..7aaa60a6d66 --- /dev/null +++ b/pages/hosted_private_cloud/opcp/how-to-use-api-and-get-credentials/meta.yaml @@ -0,0 +1,2 @@ +id: 6eb6dd6a-46a3-4f8f-b263-3362729401db +full_slug: opcp-use-api-get-credentials diff --git a/pages/index-translations.de.yaml b/pages/index-translations.de.yaml index 5dac99c7303..8ebd560a52a 100644 --- a/pages/index-translations.de.yaml +++ b/pages/index-translations.de.yaml @@ -78,6 +78,8 @@ hosted-private-cloud-hosted-private-cloud-powered-by-vmware-tanzu: VMware Tanzu hosted-private-cloud-hosted-private-cloud-powered-by-vmware-secnumcloud: SecNumCloud hosted-private-cloud-hosted-private-cloud-powered-by-vmware-vrops: VMware vROps hosted-private-cloud-hosted-private-cloud-powered-by-vmware-migration: Migration +hosted-private-cloud-hosted-private-cloud-opcp: On-Prem Cloud Plateform +hosted-private-cloud-hosted-private-cloud-opcp-getting-started: Erste Schritte hosted-private-cloud-sap-ovhcloud: SAP on OVHcloud hosted-private-cloud-sap-ovhcloud-concepts: Konzepte hosted-private-cloud-sap-ovhcloud-getting-started: Erste Schritte @@ -391,4 +393,4 @@ observability-logs-data-platform-visualizing-querying-exploiting: Visualizing, q observability-logs-data-platform-opensearch-index: OpenSearch Index as a service observability-logs-data-platform-security-conformity: Security and conformity observability-logs-data-platform-usecases: Usecases -observability-logs-data-platform-services-logs: OVHcloud Service Logs \ No newline at end of file +observability-logs-data-platform-services-logs: OVHcloud Service Logs diff --git a/pages/index-translations.es.yaml b/pages/index-translations.es.yaml index 0af79bcc440..f3580663017 100755 --- a/pages/index-translations.es.yaml +++ b/pages/index-translations.es.yaml @@ -78,6 +78,8 @@ hosted-private-cloud-hosted-private-cloud-powered-by-vmware-tanzu: VMware Tanzu hosted-private-cloud-hosted-private-cloud-powered-by-vmware-secnumcloud: SecNumCloud hosted-private-cloud-hosted-private-cloud-powered-by-vmware-vrops: VMware vROps hosted-private-cloud-hosted-private-cloud-powered-by-vmware-migration: Migración +hosted-private-cloud-hosted-private-cloud-opcp: On-Prem Cloud Plateform +hosted-private-cloud-hosted-private-cloud-opcp-getting-started: Primeros pasos hosted-private-cloud-sap-ovhcloud: SAP on OVHcloud hosted-private-cloud-sap-ovhcloud-concepts: Conceptos hosted-private-cloud-sap-ovhcloud-getting-started: Primeros pasos diff --git a/pages/index-translations.fq.yaml b/pages/index-translations.fq.yaml index 7e29b26ccb8..fb2917afd4a 100755 --- a/pages/index-translations.fq.yaml +++ b/pages/index-translations.fq.yaml @@ -78,6 +78,8 @@ hosted-private-cloud-hosted-private-cloud-powered-by-vmware-tanzu: VMware Tanzu hosted-private-cloud-hosted-private-cloud-powered-by-vmware-secnumcloud: SecNumCloud hosted-private-cloud-hosted-private-cloud-powered-by-vmware-vrops: VMware vROps hosted-private-cloud-hosted-private-cloud-powered-by-vmware-migration: Migration +hosted-private-cloud-hosted-private-cloud-opcp: On-Prem Cloud Plateform +hosted-private-cloud-hosted-private-cloud-opcp-getting-started: Premiers pas hosted-private-cloud-sap-ovhcloud: SAP on OVHcloud hosted-private-cloud-sap-ovhcloud-concepts: Concepts hosted-private-cloud-sap-ovhcloud-getting-started: Premiers pas diff --git a/pages/index-translations.fr.yaml b/pages/index-translations.fr.yaml index ab57fda0c55..7f4b96fd7c8 100755 --- a/pages/index-translations.fr.yaml +++ b/pages/index-translations.fr.yaml @@ -79,6 +79,8 @@ hosted-private-cloud-hosted-private-cloud-powered-by-vmware-tanzu: VMware Tanzu hosted-private-cloud-hosted-private-cloud-powered-by-vmware-secnumcloud: SecNumCloud hosted-private-cloud-hosted-private-cloud-powered-by-vmware-vrops: VMware vROps hosted-private-cloud-hosted-private-cloud-powered-by-vmware-migration: Migration +hosted-private-cloud-hosted-private-cloud-opcp: On-Prem Cloud Plateform +hosted-private-cloud-hosted-private-cloud-opcp-getting-started: Premiers pas hosted-private-cloud-sap-ovhcloud: SAP on OVHcloud hosted-private-cloud-sap-ovhcloud-concepts: Concepts hosted-private-cloud-sap-ovhcloud-getting-started: Premiers pas diff --git a/pages/index-translations.it.yaml b/pages/index-translations.it.yaml index 67bbc63304a..804e916d610 100644 --- a/pages/index-translations.it.yaml +++ b/pages/index-translations.it.yaml @@ -78,6 +78,8 @@ hosted-private-cloud-hosted-private-cloud-powered-by-vmware-tanzu: VMware Tanzu hosted-private-cloud-hosted-private-cloud-powered-by-vmware-secnumcloud: SecNumCloud hosted-private-cloud-hosted-private-cloud-powered-by-vmware-vrops: VMware vROps hosted-private-cloud-hosted-private-cloud-powered-by-vmware-migration: Migrazione +hosted-private-cloud-hosted-private-cloud-opcp: On-Prem Cloud Plateform +hosted-private-cloud-hosted-private-cloud-opcp-getting-started: Per iniziare hosted-private-cloud-sap-ovhcloud: SAP on OVHcloud hosted-private-cloud-sap-ovhcloud-concepts: Concetti hosted-private-cloud-sap-ovhcloud-getting-started: Per iniziare diff --git a/pages/index-translations.pl.yaml b/pages/index-translations.pl.yaml index 4149b028605..3e716e990b8 100755 --- a/pages/index-translations.pl.yaml +++ b/pages/index-translations.pl.yaml @@ -78,6 +78,8 @@ hosted-private-cloud-hosted-private-cloud-powered-by-vmware-tanzu: VMware Tanzu hosted-private-cloud-hosted-private-cloud-powered-by-vmware-secnumcloud: SecNumCloud hosted-private-cloud-hosted-private-cloud-powered-by-vmware-vrops: VMware vROps hosted-private-cloud-hosted-private-cloud-powered-by-vmware-migration: Migracja +hosted-private-cloud-hosted-private-cloud-opcp: On-Prem Cloud Plateform +hosted-private-cloud-hosted-private-cloud-opcp-getting-started: Pierwsze kroki hosted-private-cloud-sap-ovhcloud: SAP on OVHcloud hosted-private-cloud-sap-ovhcloud-concepts: Koncepcje hosted-private-cloud-sap-ovhcloud-getting-started: Pierwsze kroki diff --git a/pages/index-translations.pt.yaml b/pages/index-translations.pt.yaml index 52714a3a54d..bc86373e03e 100755 --- a/pages/index-translations.pt.yaml +++ b/pages/index-translations.pt.yaml @@ -78,6 +78,8 @@ hosted-private-cloud-hosted-private-cloud-powered-by-vmware-tanzu: VMware Tanzu hosted-private-cloud-hosted-private-cloud-powered-by-vmware-secnumcloud: SecNumCloud hosted-private-cloud-hosted-private-cloud-powered-by-vmware-vrops: VMware vROps hosted-private-cloud-hosted-private-cloud-powered-by-vmware-migration: Migração +hosted-private-cloud-hosted-private-cloud-opcp: On-Prem Cloud Plateform +hosted-private-cloud-hosted-private-cloud-opcp-getting-started: Primeiros passos hosted-private-cloud-sap-ovhcloud: SAP on OVHcloud hosted-private-cloud-sap-ovhcloud-concepts: Conceitos hosted-private-cloud-sap-ovhcloud-getting-started: Primeiros passos diff --git a/pages/index.md b/pages/index.md index 37a28e7225e..8780b0d09a7 100644 --- a/pages/index.md +++ b/pages/index.md @@ -550,6 +550,9 @@ + [Move2Cloud - Migrating VMware Workloads to OVHcloud Hosted Private Cloud with Veeam Replication](hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_migration_veeam) + [Move2Cloud - Migrating VMware Workloads to OVHcloud Hosted Private Cloud with Zerto](hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_migration_zerto) + [Migrating OmniOS datastores](hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_migration_omnios) + + [OPCP](hosted-private-cloud-opcp) + + [Getting started](hosted-private-cloud-opcp-getting-started) + + [How to use API and get credentials](hosted_private_cloud/opcp/how-to-use-api-and-get-credentials) + [Nutanix on OVHcloud](products/hosted-private-cloud-nutanix-on-ovhcloud) + [Getting started](hosted-private-cloud-nutanix-on-ovhcloud-getting-started) + [Nutanix global high-level documentation](hosted_private_cloud/nutanix_on_ovhcloud/01-global-high-level-doc)