From a5cd9547e8b08e67ec2c1fd5d23739966d01b84f Mon Sep 17 00:00:00 2001 From: Dario Date: Sat, 23 Nov 2024 02:06:46 +0100 Subject: [PATCH 1/2] add provider configuration documentation --- README.md | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0b26ae4..cf7fb42 100644 --- a/README.md +++ b/README.md @@ -91,4 +91,43 @@ def fetch_configuration } end -``` \ No newline at end of file +``` + +# Configuration + +As you already know, we allow / require to pass in a configuration. Here are all avaiable configuration keys: + + +## Oauth Based: +Here is the updated table where each key in the JSON (`identifier`, `username`, etc.) is explicitly labeled: + +| Name | Description | Default | +|------------------------------------|--------------------------------------------------------------------------------------------|-----------------------------------------------------| +| `client_id` | The client id of the application (needs to be set) | **(no default specified)** | +| `client_secret` | The client secret of the application (needs to be set) | **(no default specified)** | +| `redirect_uri` | The redirect URL of the application (needs to be set) | **(no default specified)** | +| `provider_name` | The provider name (not necessarily) | depends on the provider (e.g., `discord`, `github`) | +| `user_details_url` | The user details URL to gather user information (only for OIDC) | **(no default specified)** | +| `authorization_url` | The URL which the user has to access to authorize (only for OIDC) | **(no default specified)** | +| `attribute_statements` | The keys which the response of the user details has (id, name, email, ...) (only for OIDC) | `{}` (see below for more) | +| `attribute_statements.identifier` | The identifier of the user to identify (only for OIDC) | `["id", "sub", "identifier"]` | +| `attribute_statements.username` | The username of the user (only for OIDC) | `["username", "name", "login"]` | +| `attribute_statements.email` | The email address of the user (only for OIDC) | `["email", "mail"]` | +| `attribute_statements.firstname` | The first name of the user (only for OIDC) | `["first_name", "firstname", ...]` | +| `attribute_statements.lastname` | The last name of the user (only for OIDC) | `["last_name", "lastname", ...]` | + +## SAML + +| Name | Description | Default | +|----------------------------------|------------------------------------------------------------------------------------------------------------|------------------------------------| +| `provider_name` | The provider name (not necessarily) | `saml` | +| `attribute_statements` | The keys which the response of the user details has (id, name, email, ...) (only for OIDC) | `{}` (see below for more) | +| `attribute_statements.username` | The username of the user | `["username", "name", ...]` | +| `attribute_statements.email` | The email address of the user | `["email", "mail", ...]` | +| `attribute_statements.firstname` | The first name of the user | `["first_name", "firstname", ...]` | +| `attribute_statements.lastname` | The last name of the user | `["last_name", "lastname", ...]` | +| `settings` | The settings to configure the saml response/requests (see https://github.com/SAML-Toolkits/ruby-saml) | `{}` | +| `response_settings` | The response settings to disable some checks if you want (see https://github.com/SAML-Toolkits/ruby-saml) | `{}` | +| `metadata_url` | The metadata url to fetch the metadatas (replacement for `settings`) | **(no default specified)** | + + From c918f40a8e8f0d0ae39e6fc7a7d32254b0f076d1 Mon Sep 17 00:00:00 2001 From: Dario Date: Sat, 23 Nov 2024 12:46:31 +0100 Subject: [PATCH 2/2] change the reference link --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index cf7fb42..17cfaa1 100644 --- a/README.md +++ b/README.md @@ -118,16 +118,16 @@ Here is the updated table where each key in the JSON (`identifier`, `username`, ## SAML -| Name | Description | Default | -|----------------------------------|------------------------------------------------------------------------------------------------------------|------------------------------------| -| `provider_name` | The provider name (not necessarily) | `saml` | -| `attribute_statements` | The keys which the response of the user details has (id, name, email, ...) (only for OIDC) | `{}` (see below for more) | -| `attribute_statements.username` | The username of the user | `["username", "name", ...]` | -| `attribute_statements.email` | The email address of the user | `["email", "mail", ...]` | -| `attribute_statements.firstname` | The first name of the user | `["first_name", "firstname", ...]` | -| `attribute_statements.lastname` | The last name of the user | `["last_name", "lastname", ...]` | -| `settings` | The settings to configure the saml response/requests (see https://github.com/SAML-Toolkits/ruby-saml) | `{}` | -| `response_settings` | The response settings to disable some checks if you want (see https://github.com/SAML-Toolkits/ruby-saml) | `{}` | -| `metadata_url` | The metadata url to fetch the metadatas (replacement for `settings`) | **(no default specified)** | +| Name | Description | Default | +|----------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------| +| `provider_name` | The provider name (not necessarily) | `saml` | +| `attribute_statements` | The keys which the response of the user details has (id, name, email, ...) (only for OIDC) | `{}` (see below for more) | +| `attribute_statements.username` | The username of the user | `["username", "name", ...]` | +| `attribute_statements.email` | The email address of the user | `["email", "mail", ...]` | +| `attribute_statements.firstname` | The first name of the user | `["first_name", "firstname", ...]` | +| `attribute_statements.lastname` | The last name of the user | `["last_name", "lastname", ...]` | +| `settings` | The settings to configure the saml response/requests (see [SAML-Toolkits#L200](https://github.com/SAML-Toolkits/ruby-saml/blob/master/README.md?plain=1#L200)) | `{}` | +| `response_settings` | The response settings to disable some checks if you want (see [SAML-Toolkits#L234](https://github.com/SAML-Toolkits/ruby-saml/blob/master/README.md?plain=1#L234)) | `{}` | +| `metadata_url` | The metadata url to fetch the metadatas (replacement for `settings`) | **(no default specified)** |