Skip to content

add provider configuration documentation #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,43 @@ def fetch_configuration
}
end

```
```

# 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 [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)** |


Loading