<commit_before># Configure Keystone to enable SAML2 to act as IDP

One of the configuration models supported by Keystone for federated identity is  Keystone as Identity Provider (IdP).


## Configuration
Based on [Keystone as an Identity Provider](https://docs.openstack.org/keystone/stein/admin/federation/configure_federation.html#keystone-as-idp)

These new DOCKER options should be used:

- SAML_ENDPOINT
This env var will be expanded in /etc/keystone/keystone.conf

```
[saml]
idp_entity_id=https://$SAML_ENDPOINT/v3/OS-FEDERATION/saml2/idp
idp_sso_endpoint=https://$SAML_ENDPOINT/v3/OS-FEDERATION/saml2/sso
```

- SAML_CERTFILE
This env var will be expanded in /etc/keystone/keystone.conf

```
[saml]
certfile=/etc/keystone/ssl/certs/signing_cert.pem
```

- SAML_KEYFILE
This env var will be expanded in /etc/keystone/keystone.conf

```
[saml]
keyfile=/etc/keystone/ssl/private/signing_key.pem
```

And then a Service Provider must be created and registered into IdP Keystone.
To achive that get into container and set following env vars:

```
export KEYSTONE_HOST="127.0.0.1:5001"
export OS_USERNAME=admin
export OS_PROJECT_NAME=admin
export OS_USER_DOMAIN_ID=default
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_DOMAIN_ID=default
export OS_PROJECT_DOMAIN_NAME=Default
export OS_AUTH_URL=http://127.0.0.1:5001/v3<commit_msg>Update docs/iotp_saml_idp.md<commit_after># Configure Keystone to enable SAML2 to act as IDP

One of the configuration models supported by Keystone for federated identity is  Keystone as Identity Provider (IdP).


## Configuration
Based on [Keystone as an Identity Provider](https://docs.openstack.org/keystone/stein/admin/federation/configure_federation.html#keystone-as-idp)

These new DOCKER options should be used:

- SAML_ENDPOINT
This env var will be expanded in /etc/keystone/keystone.conf

```
[saml]
idp_entity_id=https://$SAML_ENDPOINT/v3/OS-FEDERATION/saml2/idp
idp_sso_endpoint=https://$SAML_ENDPOINT/v3/OS-FEDERATION/saml2/sso
```

- SAML_CERTFILE
This env var will be expanded in /etc/keystone/keystone.conf

```
[saml]
certfile=/etc/keystone/ssl/certs/signing_cert.pem
```

- SAML_KEYFILE
This env var will be expanded in /etc/keystone/keystone.conf

```
[saml]
keyfile=/etc/keystone/ssl/private/signing_key.pem
```

And then a Service Provider must be created and registered into IdP Keystone.
To achive that, get into container and set following env vars:

```
export KEYSTONE_HOST="127.0.0.1:5001"
export OS_USERNAME=admin
export OS_PROJECT_NAME=admin
export OS_USER_DOMAIN_ID=default
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_DOMAIN_ID=default
export OS_PROJECT_DOMAIN_NAME=Default
export OS_AUTH_URL=http://127.0.0.1:5001/v3
{'fraction_non_alphanumeric': 0.09613956941351151, 'fraction_numerical': 0.019302152932442463, 'mean_word_length': 5.573170731707317, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '75837', 'n_tokens_mistral': 1049, 'n_tokens_neox': 959, 'n_words': 232}