|
2 | 2 |
|
3 | 3 | ## Overview |
4 | 4 |
|
5 | | -This service was inspired by Auth0, through their example at https://github.com/auth0-samples/auth0-cas-server. It is a simple authentication redirector which wraps an OpenID Connect authentication flow to expose it as server implementing the Central Authentication Service (CAS) SSO protocol. The service leverages configuration stored within Auth0 client metadata, which it reads using a privileged connection to the Auth0 API, in order to emulate multiple different clients dynamically per login session. |
| 5 | +This service was inspired by Auth0, through their example at |
| 6 | +[auth0-samples/auth0-cas-server](https://github.com/auth0-samples/auth0-cas-server). |
| 7 | +It is a simple authentication redirector which wraps an OpenID Connect |
| 8 | +authentication flow to expose it as server implementing the Central |
| 9 | +Authentication Service (CAS) SSO protocol. The service leverages configuration |
| 10 | +stored within Auth0 client metadata, which it reads using a privileged |
| 11 | +connection to the Auth0 API, in order to emulate multiple different clients |
| 12 | +dynamically per login session. |
6 | 13 |
|
7 | 14 | Notable differeces with this implementation: |
8 | 15 |
|
9 | | -- Rewritten in Go, including OpenTelemetry instrumentation and multi-arch build outputs including SPDX SBOMs. |
10 | | -- Supports several additional CAS protocol endpoints implementing multiple CAS versions. |
| 16 | +- Rewritten in Go, including OpenTelemetry instrumentation and multi-arch build |
| 17 | + outputs including SPDX SBOMs. |
| 18 | +- Supports several additional CAS protocol endpoints implementing multiple CAS |
| 19 | + versions. |
11 | 20 | - Implements CAS single-logout. |
12 | | -- Implements CAS "gateway mode" to test for authentication without prompting the user. |
| 21 | +- Implements CAS "gateway mode" to test for authentication without prompting |
| 22 | + the user. |
13 | 23 | - Supports both XML and JSON CAS response formats. |
14 | | -- Allows for path wildcards and multiple, comma-separated CAS service definitions in `client_metadata.cas_service` configuration. |
| 24 | +- Allows for path wildcards and multiple, comma-separated CAS service |
| 25 | + definitions in `client_metadata.cas_service` configuration. |
15 | 26 |
|
16 | 27 | ## Linux Foundation specific changes |
17 | 28 |
|
18 | | -The following hardcoded behavior is specific to the Linux Foundation's Auth0 environment: |
| 29 | +The following hardcoded behavior is specific to the Linux Foundation's Auth0 |
| 30 | +environment: |
19 | 31 |
|
20 | | -- LF-namespaced OIDC claims used for username and group attributes coming from IdP. |
21 | | -- Custom CAS attributes: `uid`, `field_lf_*` and `profile_name_*` added to match our reference implementation. |
| 32 | +- LF-namespaced OIDC claims used for username and group attributes coming from |
| 33 | + IdP. |
| 34 | +- Custom CAS attributes: `uid`, `field_lf_*` and `profile_name_*` added to |
| 35 | + match our reference implementation. |
22 | 36 |
|
23 | | -Porting these into a dynamic configuration system would be useful for generalizing this tool. For instance, a toml file could map upstream OIDC claims to both required CAS fields as well as optional additional CAS attributes, and provide per-attribute customization of the mb4-filtering feature. |
| 37 | +Porting these into a dynamic configuration system would be useful for |
| 38 | +generalizing this tool. For instance, a toml file could map upstream OIDC |
| 39 | +claims to both required CAS fields as well as optional additional CAS |
| 40 | +attributes, and provide per-attribute customization of the mb4-filtering |
| 41 | +feature. |
24 | 42 |
|
25 | 43 | ## Deploying and running the server |
26 | 44 |
|
27 | 45 | You can pull the latest image from the GitHub Container Registry: |
28 | 46 |
|
29 | | -``` |
| 47 | +```bash |
30 | 48 | docker pull ghcr.io/linuxfoundation/auth0-cas-server-go:latest |
31 | 49 | ``` |
32 | 50 |
|
33 | | -Pinning your deployments to a release label (rather than ":latest") is recommended for production use. |
| 51 | +Pinning your deployments to a release label (rather than ":latest") is |
| 52 | +recommended for production use. |
34 | 53 |
|
35 | | -Please see `env-example` for a list of required and optional environment variables that can be used to configure the server. For local development, you can copy this file to `.env` and modify it to suit your needs. |
| 54 | +Please see `env-example` for a list of required and optional environment |
| 55 | +variables that can be used to configure the server. For local development, you |
| 56 | +can copy this file to `.env` and modify it to suit your needs. |
36 | 57 |
|
37 | 58 | ## Auth0 client configuration |
38 | 59 |
|
39 | 60 | To create a CAS-enabled Auth0 application, specify the follow settings: |
40 | 61 |
|
41 | 62 | - Application Type: Regular Web Application |
42 | 63 | - Allowed Callback URLs: `https://<auth0-cas-server-go>/cas/oidc_callback` |
43 | | -- Allowed Logout URLs (optional): the CAS logout return URL of your application, if passed by the CAS client ("service" for v3 logout, or "url" for v2 logout). |
44 | | -- Advanced -> Application Metadata: add Key "cas\_service" with Value of one-or-more (comma-separated) URLs which match the "service" parameter of the CAS application's login request. A `*` will match any subdomain or a single path component, while `**` matches anything (including `/`). |
| 64 | +- Allowed Logout URLs (optional): the CAS logout return URL of your |
| 65 | + application, if passed by the CAS client ("service" for v3 logout, or "url" |
| 66 | + for v2 logout). |
| 67 | +- Advanced -> Application Metadata: add Key "cas\_service" with Value of |
| 68 | + one-or-more (comma-separated) URLs which match the "service" parameter of the |
| 69 | + CAS application's login request. A `*` will match any subdomain or a single |
| 70 | + path component, while `**` matches anything (including `/`). |
45 | 71 | - Advanced -> OAuth -> OIDC Conformant: Enabled |
46 | 72 |
|
47 | | -Multiple apps CAS can be created for different sites: each will have the same callback URL, but they will have different `cas_service` URLs (and logout URLs, if needed). |
| 73 | +Multiple apps CAS can be created for different sites: each will have the same |
| 74 | +callback URL, but they will have different `cas_service` URLs (and logout URLs, |
| 75 | +if needed). |
48 | 76 |
|
49 | | -Auth0 client configurations read by this service are cached for performance. New apps should work automatically, but changes to `cas_service` URL patterns for existing apps may require a restart of the service to take effect. |
| 77 | +Auth0 client configurations read by this service are cached for performance. |
| 78 | +New apps should work automatically, but changes to `cas_service` URL patterns |
| 79 | +for existing apps may require a restart of the service to take effect. |
50 | 80 |
|
51 | 81 | ## License |
52 | 82 |
|
53 | 83 | Copyright The Linux Foundation and its contributors. |
54 | 84 |
|
55 | | -This project's source code is licensed under the MIT License. A copy of the license is available in LICENSE. |
| 85 | +This project's source code is licensed under the MIT License. A copy of the |
| 86 | +license is available in LICENSE. |
56 | 87 |
|
57 | | -This project's documentation is licensed under the Creative Commons Attribution 4.0 International License (CC-BY-4.0). A copy of the license is available in LICENSE-docs. |
| 88 | +This project's documentation is licensed under the Creative Commons Attribution |
| 89 | +4.0 International License (CC-BY-4.0). A copy of the license is available in |
| 90 | +LICENSE-docs. |
0 commit comments