-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add FAQ * Update CONTRIBUTING.md * Add generic configuration * Add GOOGLE Provider configuration * Add GITLAB configuration
- Loading branch information
1 parent
a971cb1
commit 7201721
Showing
7 changed files
with
288 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Frequently Asked Questions | ||
|
||
## Odd issues | ||
|
||
Issues that were reported and solved without clear root cause. | ||
|
||
### Crumb issues | ||
|
||
*Symptom*: Jenkins reports multiple crumb issues and is unable to logout user. | ||
|
||
*Providers*: OKTA | ||
|
||
*Details* | ||
|
||
Logs contains warnings about crumb and CSRF issues: | ||
|
||
``` | ||
2023-02-24 15:47:05.103+0000 [id=127] WARNING hudson.security.csrf.CrumbFilter#doFilter: Found invalid crumb 0b13bbc28c54659d3ea7f105cb9e49bb50898d77ec94f821fad1bf28dca956f6. If you are calling this URL with a script, please use the API Token instead. More information: https://www.jenkins.io/redirect/crumb-cannot-be-used-for-script | ||
2023-02-24 15:47:05.107+0000 [id=127] WARNING hudson.security.csrf.CrumbFilter#doFilter: No valid crumb was included in request for /manage/descriptorByName/org.jenkinsci.plugins.oic.OicSecurityRealm/checkPostLogoutRedirectUrl by 00u8erxt6sBAIguA65d7. Returning 403. | ||
``` | ||
|
||
*Workaround* | ||
|
||
This was solved by installin the [Strict Crumb Issuer](https://plugins.jenkins.io/strict-crumb-issuer/) plugin. | ||
Relevant JCasC configuration is the following: | ||
|
||
```jenkins: | ||
crumbIssuer: | ||
strict: | ||
checkOnlyLocalPath: true | ||
checkSameSource: true | ||
hoursValid: 8 | ||
disableRememberMe: false | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Gilab Provider | ||
|
||
[Gitlab][1] can be used as as an OpenID Connect identity provider. | ||
|
||
## Provider configuration | ||
|
||
An application must be setup on Gitlab as describe in the documentation | ||
of [OAuth 2.0 authentication identity provider][2]. The application must | ||
be configured with: | ||
|
||
- scopes: openid profile email | ||
- redirect URI: `https://<name>/<jenkins>/securityRealm/finishLogin`. | ||
|
||
In order to obtain the client id and secret: | ||
|
||
- the OAuth 2 Client ID is provided in the Application ID field. | ||
- the OAuth 2 Client Secret is accessed by selecting Copy in the Secret field | ||
|
||
|
||
## Plugin configuration | ||
|
||
Gitla provides a well known configuration endpoint which can be used | ||
for automating endpoint configuration. It also supports PKCE | ||
verification for additional security. | ||
|
||
Except for those parameters and the choice of user information, default parameters value are suitable. | ||
|
||
### User information | ||
|
||
The following user information is used by the plugin: | ||
|
||
| field | description | | ||
| ----- | ----------- | | ||
| sub | The user's GitLab username | | ||
| email | he user's primary email address | | ||
| name | The user's full name | | ||
| groups | Paths for the groups the user is a member of | | ||
|
||
The flag for overriding scope must be set for requesting only needed | ||
scopes. | ||
|
||
### JCasC | ||
|
||
```yaml | ||
jenkins: | ||
securityRealm: | ||
oic: | ||
wellKnownOpenIDConfigurationUrl: https://gitlab.com/.well-known/openid-configuration | ||
automanualconfigure: auto | ||
clientId: identifier-client-id | ||
clientSecret: identifuer-client-secret | ||
overrideScopes: openid profile email | ||
userNameField: preferred_username | ||
fullNameFieldName: name | ||
emailFieldName: email | ||
groupFieldName: groups | ||
pkceEnabled: true | ||
``` | ||
[1]: https://docs.gitlab.com/ee/integration/openid_connect_provider.html | ||
[2]: https://docs.gitlab.com/ee/integration/oauth_provider.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Google Provider | ||
|
||
The [Google's OAuth 2.0 APIs][1] implementation for authentication | ||
conforms to the OpenID Connect specification. | ||
|
||
|
||
## Provider configuration | ||
|
||
A project must be setup in the [Google API Console][2] which will be | ||
associated to your Jenkins instance. In the identifiers section, create | ||
new "OAuth Client ID" identifier | ||
|
||
- application type: `Web application` | ||
- name: any name which is meaningful for you | ||
- authorized redirection URI: `https://<name>/<jenkins>/securityRealm/finishLogin` | ||
|
||
After, clicking on the creation button, a popup window provides the | ||
client Id and the associated client secret to be used in the | ||
configuration of the plugin. | ||
|
||
Additional configurations are available as indicated in [Google's documentation][1] such as the customization of the consent screen. | ||
|
||
## Plugin configuration | ||
|
||
Google provides a well known configuration endpoint which can be used | ||
for automating endpoint configuration. It also supports PKCE | ||
verification for additional security. | ||
|
||
Except for those parameters and the choice of user information, default parameters value are suitable. | ||
|
||
### User information | ||
|
||
The following user information is used by the plugin: | ||
|
||
| field | scope | description | | ||
| ----- | ----- | ----------- | | ||
| sub | (always) | An identifier for the user, unique among all Google accounts. | | ||
| email | email | The user's email address. | | ||
| name | profile | The user's full name, in a displayable form. | | ||
| hd | (optional) | The domain associated with the Google Workspace or Cloud organization of the user. | | ||
|
||
The flag for overriding scope must be set for requesting only needed | ||
scopes. | ||
|
||
### JCasC | ||
|
||
```yaml | ||
jenkins: | ||
securityRealm: | ||
oic: | ||
wellKnownOpenIDConfigurationUrl: https://accounts.google.com/.well-known/openid-configuration | ||
automanualconfigure: auto | ||
clientId: identifier-client-id | ||
clientSecret: identifuer-client-secret | ||
overrideScopes: openid profile name email | ||
userNameField: sub | ||
fullNameFieldName: name | ||
emailFieldName: email | ||
pkceEnabled: true | ||
``` | ||
[1]: https://developers.google.com/identity/openid-connect/openid-connect | ||
[2]: https://console.developers.google.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Plugin configuration | ||
|
||
The OpenID Connect authentication plugin tries to support a wide range | ||
of OpenID providers. The configuration reflects the various ways the | ||
plugin accomodates their differences and provide a way to select the | ||
information to extract. | ||
|
||
There are specifics instructions for well known providers: | ||
|
||
* [Google Provider](GOOGLE.md) | ||
* [Gitlab Provider](GITLAB.md) | ||
|
||
|
||
## Provider configuration | ||
|
||
The OpenID Conenct spec describes a well known configuration location | ||
which will also help discovering your settings | ||
(<https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfig>) | ||
|
||
From 1.5 and onward the well known configuration location may be used to | ||
populate the configuration simplifying the configuration greatly. | ||
|
||
## JCasC configuration reference | ||
|
||
JCasC configuration can be defined with the following fields: | ||
|
||
```yaml | ||
jenkins: | ||
securityRealm: | ||
oic: | ||
# Endpoints | ||
automanualconfigure: <string:enum> | ||
wellKnownOpenIDConfigurationUrl: <url> | ||
tokenServerUrl: <url> | ||
authorizationServerUrl: <url> | ||
# Credentials | ||
clientId: <string> | ||
clientSecret: <string:secret> | ||
tokenAuthMethod: <string:enum> | ||
# claims | ||
scopes: <string:space separated words> | ||
userNameField: <string:jmes path> | ||
groupsFieldName: <string:jmes path> | ||
fullNameFieldName: <string: jmes path> | ||
emailFieldName: <string:jmes path> | ||
# advanced configuration | ||
logoutFromOpenidProvider: <boolean> | ||
rootURLFromRequest: <boolean> | ||
sendScopesInTokenRequest: <boolean> | ||
# Security | ||
disableSslVerification: <boolean> | ||
nonceDisabled: <boolean> | ||
pkceEnabled: <boolean> | ||
tokenFieldToCheckKey: <string:jmes path> | ||
tokenFieldToCheckValue: string | ||
# escape hatch | ||
escapeHatchEnabled: <boolean> | ||
escapeHatchUsername: escapeHatchUsername | ||
escapeHatchSecret: <string:secret> | ||
escapeHatchGroup: <string> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters