mirror of
https://github.com/ansible/awx.git
synced 2026-02-01 01:28:09 -03:30
Edit AWX docs
This commit is contained in:
@@ -7,18 +7,18 @@ When a user wants to log into Tower, she can explicitly choose some of the suppo
|
||||
* Github Team OAuth2
|
||||
* Microsoft Azure Active Directory (AD) OAuth2
|
||||
|
||||
On the other hand, the rest of authentication methods use the same types of login info as Tower(username and password), but authenticate using external auth systems rather than Tower's own database. If some of these methods are enabled, Tower will try authenticating using the enabled methods *before Tower's own authentication method*. In specific, it follows the order
|
||||
On the other hand, the other authentication methods use the same types of login info as Tower (username and password), but authenticate using external auth systems rather than Tower's own database. If some of these methods are enabled, Tower will try authenticating using the enabled methods *before Tower's own authentication method*. The order of precedence is:
|
||||
* LDAP
|
||||
* RADIUS
|
||||
* TACACS+
|
||||
* SAML
|
||||
|
||||
Tower will try authenticating against each enabled authentication method *in the specified order*, meaning if the same username and password is valid in multiple enabled auth methods (For example, both LDAP and TACACS+), Tower will only use the first positive match (In the above example, log a user in via LDAP and skip TACACS+).
|
||||
Tower will try authenticating against each enabled authentication method *in the specified order*, meaning if the same username and password is valid in multiple enabled auth methods (*e.g.*, both LDAP and TACACS+), Tower will only use the first positive match (in the above example, log a user in via LDAP and skip TACACS+).
|
||||
|
||||
## Notes:
|
||||
* SAML users, RADIUS users and TACACS+ users are categorized as 'Enterprise' users. The following rules apply to Enterprise users:
|
||||
SAML users, RADIUS users and TACACS+ users are categorized as 'Enterprise' users. The following rules apply to Enterprise users:
|
||||
|
||||
* Enterprise users can only be created via the first successful login attempt from remote authentication backend.
|
||||
* Enterprise users cannot be created/authenticated if non-enterprise users with the same name has already been created in Tower.
|
||||
* Tower passwords of Enterprise users should always be empty and cannot be set by any user if there are enterprise backends enabled.
|
||||
* If enterprise backends are disabled, an Enterprise user can be converted to a normal Tower user by setting password field. But this operation is irreversible (The converted Tower user can no longer be treated as Enterprise user)
|
||||
* If enterprise backends are disabled, an Enterprise user can be converted to a normal Tower user by setting password field. But this operation is irreversible (the converted Tower user can no longer be treated as Enterprise user).
|
||||
|
||||
@@ -1,18 +1,21 @@
|
||||
# LDAP
|
||||
The Lightweight Directory Access Protocol (LDAP) is an open, vendor-neutral, industry standard application protocol for accessing and maintaining distributed directory information services over an Internet Protocol (IP) network. Directory services play an important role in developing intranet and Internet applications by allowing the sharing of information about users, systems, networks, services, and applications throughout the network.
|
||||
The Lightweight Directory Access Protocol (LDAP) is an open, vendor-neutral, industry-standard application protocol for accessing and maintaining distributed directory information services over an Internet Protocol (IP) network. Directory services play an important role in developing intranet and Internet applications by allowing the sharing of information about users, systems, networks, services, and applications throughout the network.
|
||||
|
||||
|
||||
# Configure LDAP Authentication
|
||||
Please see the Tower documentation as well as Ansible blog posts for basic LDAP configuration.
|
||||
|
||||
Please see the [Tower documentation](https://docs.ansible.com/ansible-tower/latest/html/administration/ldap_auth.html) as well as [Ansible blog post](https://www.ansible.com/blog/getting-started-ldap-authentication-in-ansible-tower) for basic LDAP configuration.
|
||||
|
||||
LDAP Authentication provides duplicate sets of configuration fields for authentication with up to six different LDAP servers.
|
||||
The default set of configuration fields take the form `AUTH_LDAP_<field name>`. Configuration fields for additional ldap servers are numbered `AUTH_LDAP_<n>_<field name>`.
|
||||
|
||||
## Test environment setup
|
||||
|
||||
Please see README.md of this repository: https://github.com/jangsutsr/deploy_ldap.git.
|
||||
The default set of configuration fields take the form `AUTH_LDAP_<field name>`. Configuration fields for additional LDAP servers are numbered `AUTH_LDAP_<n>_<field name>`.
|
||||
|
||||
|
||||
# Basic setup for FreeIPA
|
||||
## Test Environment Setup
|
||||
|
||||
Please see `README.md` of this repository: https://github.com/jangsutsr/deploy_ldap.git.
|
||||
|
||||
|
||||
# Basic Setup for FreeIPA
|
||||
|
||||
LDAP Server URI (append if you have multiple LDAPs)
|
||||
`ldaps://{{serverip1}}:636`
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
## Introduction
|
||||
Starting from Tower 3.3, OAuth 2 will be used as the new means of token-based authentication. Users
|
||||
will be able to manage OAuth 2 tokens as well as applications, a server-side representation of API
|
||||
clients used to generate tokens. With OAuth 2, a user can authenticate by passing a token as part of
|
||||
clients used to generate tokens. With OAuth 2, a user can authenticate by passing a token as part of
|
||||
the HTTP authentication header. The token can be scoped to have more restrictive permissions on top of
|
||||
the base RBAC permissions of the user. Refer to [RFC 6749](https://tools.ietf.org/html/rfc6749) for
|
||||
the base RBAC permissions of the user. Refer to [RFC 6749](https://tools.ietf.org/html/rfc6749) for
|
||||
more details of OAuth 2 specification.
|
||||
|
||||
## Basic Usage
|
||||
|
||||
To get started using OAuth 2 tokens for accessing the browsable API using OAuth 2, we will walkthrough acquiring a token, and using it.
|
||||
To get started using OAuth 2 tokens for accessing the browsable API using OAuth 2, this document will walk through the steps of acquiring a token and using it.
|
||||
|
||||
1. Make an application with authorization_grant_type set to 'password'. HTTP POST the following to the `/api/v2/applications/` endpoint (supplying your own organization-id):
|
||||
1. Make an application with `authorization_grant_type` set to 'password'. HTTP POST the following to the `/api/v2/applications/` endpoint (supplying your own `organization-id`):
|
||||
```
|
||||
{
|
||||
"name": "Admin Internal Application",
|
||||
@@ -22,7 +22,7 @@ To get started using OAuth 2 tokens for accessing the browsable API using OAuth
|
||||
"organization": <organization-id>
|
||||
}
|
||||
```
|
||||
2. Make a token with a POST to the `/api/v2/tokens/` endpoint:
|
||||
2. Make a token with a POST to the `/api/v2/tokens/` endpoint:
|
||||
```
|
||||
{
|
||||
"description": "My Access Token",
|
||||
@@ -32,13 +32,13 @@ To get started using OAuth 2 tokens for accessing the browsable API using OAuth
|
||||
```
|
||||
This will return a `<token-value>` that you can use to authenticate with for future requests (this will not be shown again)
|
||||
|
||||
3. Use token to access a resource. We will use curl to demonstrate this:
|
||||
3. Use token to access a resource. We will use `curl` to demonstrate this:
|
||||
```
|
||||
curl -H "Authorization: Bearer <token-value>" -X GET https://<awx>/api/v2/users/
|
||||
```
|
||||
> The `-k` flag may be needed if you have not set up a CA yet and are using SSL.
|
||||
|
||||
This token can be revoked by making a DELETE on the detail page for that token. All you need is that token's id. For example:
|
||||
This token can be revoked by making a DELETE on the detail page for that token. All you need is that token's id. For example:
|
||||
```
|
||||
curl -ku <user>:<password> -X DELETE https://<awx>/api/v2/tokens/<pk>/
|
||||
```
|
||||
@@ -48,15 +48,17 @@ Similarly, using a token:
|
||||
curl -H "Authorization: Bearer <token-value>" -X DELETE https://<awx>/api/v2/tokens/<pk>/ -k
|
||||
```
|
||||
|
||||
|
||||
## More Information
|
||||
|
||||
#### Managing OAuth 2 applications and tokens
|
||||
Applications and tokens can be managed as a top-level resource at `/api/<version>/applications` and
|
||||
`/api/<version>/tokens`. These resources can also be accessed respective to the user at
|
||||
#### Managing OAuth 2 Applications and Tokens
|
||||
|
||||
Applications and tokens can be managed as a top-level resource at `/api/<version>/applications` and
|
||||
`/api/<version>/tokens`. These resources can also be accessed respective to the user at
|
||||
`/api/<version>/users/N/<resource>`. Applications can be created by making a POST to either `api/<version>/applications`
|
||||
or `/api/<version>/users/N/applications`.
|
||||
|
||||
Each OAuth 2 application represents a specific API client on the server side. For an API client to use the API via an application token,
|
||||
Each OAuth 2 application represents a specific API client on the server side. For an API client to use the API via an application token,
|
||||
it must first have an application and issue an access token.
|
||||
|
||||
Individual applications will be accessible via their primary keys:
|
||||
@@ -111,22 +113,20 @@ generated during creation; Fields `user` and `authorization_grant_type`, on the
|
||||
*immutable on update*, meaning they are required fields on creation, but will become read-only after
|
||||
that.
|
||||
|
||||
On RBAC side:
|
||||
- system admins will be able to see and manipulate all applications in the system;
|
||||
**On RBAC side:**
|
||||
- System admins will be able to see and manipulate all applications in the system;
|
||||
- Organization admins will be able to see and manipulate all applications belonging to Organization
|
||||
members;
|
||||
- Other normal users will only be able to see, update and delete their own applications, but
|
||||
cannot create any new applications.
|
||||
|
||||
|
||||
|
||||
Tokens, on the other hand, are resources used to actually authenticate incoming requests and mask the
|
||||
permissions of the underlying user. Tokens can be created by POSTing to `/api/v2/tokens/`
|
||||
endpoint by providing `application` and `scope` fields to point to related application and specify
|
||||
token scope; or POSTing to `/api/v2/applications/<pk>/tokens/` by providing only `scope`, while
|
||||
the parent application will be automatically linked.
|
||||
|
||||
Individual tokens will be accessible via their primary keys:
|
||||
Individual tokens will be accessible via their primary keys at
|
||||
`/api/<version>/tokens/<pk>/`. Here is a typical token:
|
||||
```
|
||||
{
|
||||
@@ -162,18 +162,19 @@ Individual tokens will be accessible via their primary keys:
|
||||
"scope": "read"
|
||||
},
|
||||
```
|
||||
For an OAuth 2 token, the only fully mutable fields are `scope` and `description`. The `application`
|
||||
field is *immutable on update*, and all other fields are totally immutable, and will be auto-populated
|
||||
during creation
|
||||
* `user` field corresponds to the user the token is created for
|
||||
For an OAuth 2 token, the only fully mutable fields are `scope` and `description`. The `application`
|
||||
field is *immutable on update*, and all other fields are totally immutable, and will be auto-populated
|
||||
during creation.
|
||||
* `user` - this field corresponds to the user the token is created for
|
||||
* `expires` will be generated according to Tower configuration setting `OAUTH2_PROVIDER`
|
||||
* `token` and `refresh_token` will be auto-generated to be non-clashing random strings.
|
||||
Both application tokens and personal access tokens will be shown at the `/api/v2/tokens/`
|
||||
|
||||
Both application tokens and personal access tokens will be shown at the `/api/v2/tokens/`
|
||||
endpoint. Personal access tokens can be identified by the `application` field being `null`.
|
||||
|
||||
On RBAC side:
|
||||
**On RBAC side:**
|
||||
- A user will be able to create a token if they are able to see the related application;
|
||||
- System admin is able to see and manipulate every token in the system;
|
||||
- The System Administrator is able to see and manipulate every token in the system;
|
||||
- Organization admins will be able to see and manipulate all tokens belonging to Organization
|
||||
members;
|
||||
System Auditors can see all tokens and applications
|
||||
@@ -196,7 +197,7 @@ curl -H "Authorization: Bearer kqHqxfpHGRRBXLNCOXxT5Zt3tpJogn" http://<awx>/api/
|
||||
|
||||
According to OAuth 2 specification, users should be able to acquire, revoke and refresh an access
|
||||
token. In AWX the equivalent, and easiest, way of doing that is creating a token, deleting
|
||||
a token, and deleting a token quickly followed by creating a new one.
|
||||
a token, and deleting a token quickly followed by creating a new one.
|
||||
|
||||
The specification also provides standard ways of doing this. RFC 6749 elaborates
|
||||
on those topics, but in summary, an OAuth 2 token is officially acquired via authorization using
|
||||
@@ -211,7 +212,9 @@ endpoints under `/api/o/` endpoint. Detailed examples on the most typical usage
|
||||
are available as description text of `/api/o/`. See below for information on Application Access Token usage.
|
||||
> Note: The `/api/o/` endpoints can only be used for application tokens, and are not valid for personal access tokens.
|
||||
|
||||
#### Token scope mask over RBAC system
|
||||
|
||||
#### Token Scope Mask Over RBAC System
|
||||
|
||||
The scope of an OAuth 2 token is a space-separated string composed of keywords like 'read' and 'write'.
|
||||
These keywords are configurable and used to specify permission level of the authenticated API client.
|
||||
For the initial OAuth 2 implementation, we use the most simple scope configuration, where the only
|
||||
@@ -225,7 +228,7 @@ For example, if a user has admin permission to a job template, he/she can both s
|
||||
and delete the job template if authenticated via session or basic auth. On the other hand, if the user
|
||||
is authenticated using OAuth 2 token, and the related token scope is 'read', the user can only see but
|
||||
not manipulate or launch the job template, despite being an admin. If the token scope is
|
||||
'write' or 'read write', she can take full advantage of the job template as its admin. Note, that 'write'
|
||||
'write' or 'read write', she can take full advantage of the job template as its admin. Note that 'write'
|
||||
implies 'read' as well.
|
||||
|
||||
|
||||
@@ -235,14 +238,15 @@ This page lists OAuth 2 utility endpoints used for authorization, token refresh
|
||||
Note endpoints other than `/api/o/authorize/` are not meant to be used in browsers and do not
|
||||
support HTTP GET. The endpoints here strictly follow
|
||||
[RFC specs for OAuth 2](https://tools.ietf.org/html/rfc6749), so please use that for detailed
|
||||
reference. Here we give some examples to demonstrate the typical usage of these endpoints in
|
||||
AWX context (Note AWX net location default to `http://localhost:8013` in examples):
|
||||
reference. Below are some examples to demonstrate the typical usage of these endpoints in
|
||||
AWX context (note that the AWX net location defaults to `http://localhost:8013` in these examples).
|
||||
|
||||
|
||||
#### Application using `authorization code` grant type
|
||||
#### Application Using `authorization code` Grant Type
|
||||
|
||||
This application grant type is intended to be used when the application is executing on the server. To create
|
||||
an application named `AuthCodeApp` with the `authorization-code` grant type,
|
||||
Make a POST to the `/api/v2/applications/` endpoint.
|
||||
an application named `AuthCodeApp` with the `authorization-code` grant type,
|
||||
make a POST to the `/api/v2/applications/` endpoint:
|
||||
```text
|
||||
{
|
||||
"name": "AuthCodeApp",
|
||||
@@ -253,21 +257,22 @@ Make a POST to the `/api/v2/applications/` endpoint.
|
||||
"skip_authorization": false
|
||||
}
|
||||
```
|
||||
You can test the authorization flow out with this new application by copying the client_id and URI link into the
|
||||
homepage [here](http://django-oauth-toolkit.herokuapp.com/consumer/) and click submit. This is just a simple test
|
||||
application Django-oauth-toolkit provides.
|
||||
You can test the authorization flow out with this new application by copying the `client_id` and URI link into the
|
||||
homepage [here](http://django-oauth-toolkit.herokuapp.com/consumer/) and click submit. This is just a simple test
|
||||
application `Django-oauth-toolkit` provides.
|
||||
|
||||
From the client app, the user makes a GET to the Authorize endpoint with the `response_type`,
|
||||
From the client app, the user makes a GET to the Authorize endpoint with the `response_type`,
|
||||
`client_id`, `redirect_uris`, and `scope`. AWX will respond with the authorization `code` and `state`
|
||||
to the redirect_uri specified in the application. The client application will then make a POST to the
|
||||
`api/o/token/` endpoint on AWX with the `code`, `client_id`, `client_secret`, `grant_type`, and `redirect_uri`.
|
||||
to the `redirect_uri` specified in the application. The client application will then make a POST to the
|
||||
`api/o/token/` endpoint on AWX with the `code`, `client_id`, `client_secret`, `grant_type`, and `redirect_uri`.
|
||||
AWX will respond with the `access_token`, `token_type`, `refresh_token`, and `expires_in`. For more
|
||||
information on testing this flow, refer to [django-oauth-toolkit](http://django-oauth-toolkit.readthedocs.io/en/latest/tutorial/tutorial_01.html#test-your-authorization-server).
|
||||
|
||||
|
||||
#### Application using `password` grant type
|
||||
#### Application Using `password` Grant Type
|
||||
|
||||
This is also called the `resource owner credentials grant`. This is for use by users who have
|
||||
native access to the web app. This should be used when the client is the Resource owner. Suppose
|
||||
native access to the web app. This should be used when the client is the Resource owner. Suppose
|
||||
we have an application `Default Application` with grant type `password`:
|
||||
```text
|
||||
{
|
||||
@@ -285,7 +290,7 @@ we have an application `Default Application` with grant type `password`:
|
||||
}
|
||||
```
|
||||
|
||||
Log in is not required for `password` grant type, so we can simply use `curl` to acquire a personal access token
|
||||
Login is not required for `password` grant type, so we can simply use `curl` to acquire a personal access token
|
||||
via `/api/o/token/`:
|
||||
```bash
|
||||
curl -X POST \
|
||||
@@ -294,12 +299,12 @@ curl -X POST \
|
||||
IaUBsaVDgt2eiwOGe0bg5m5vCSstClZmtdy359RVx2rQK5YlIWyPlrolpt2LEpVeKXWaiybo" \
|
||||
http://<awx>/api/o/token/ -i
|
||||
```
|
||||
In the above post request, parameters `username` and `password` are username and password of the related
|
||||
In the above POST request, parameters `username` and `password` are the username and password of the related
|
||||
AWX user of the underlying application, and the authentication information is of format
|
||||
`<client_id>:<client_secret>`, where `client_id` and `client_secret` are the corresponding fields of
|
||||
underlying application.
|
||||
|
||||
Upon success, access token, refresh token and other information are given in the response body in JSON
|
||||
Upon success, the access token, refresh token and other information are given in the response body in JSON
|
||||
format:
|
||||
```text
|
||||
HTTP/1.1 200 OK
|
||||
@@ -317,9 +322,11 @@ Strict-Transport-Security: max-age=15768000
|
||||
{"access_token": "9epHOqHhnXUcgYK8QanOmUQPSgX92g", "token_type": "Bearer", "expires_in": 315360000000, "refresh_token": "jMRX6QvzOTf046KHee3TU5mT3nyXsz", "scope": "read"}
|
||||
```
|
||||
|
||||
|
||||
## Token Functions
|
||||
|
||||
#### Refresh an existing access token
|
||||
#### Refresh an Existing Access Token
|
||||
|
||||
Suppose we have an existing access token with refresh token provided:
|
||||
```text
|
||||
{
|
||||
@@ -334,14 +341,14 @@ Suppose we have an existing access token with refresh token provided:
|
||||
"scope": "read write"
|
||||
}
|
||||
```
|
||||
The `/api/o/token/` endpoint is used for refreshing access token:
|
||||
The `/api/o/token/` endpoint is used for refreshing the access token:
|
||||
```bash
|
||||
curl -X POST \
|
||||
-d "grant_type=refresh_token&refresh_token=AL0NK9TTpv0qp54dGbC4VUZtsZ9r8z" \
|
||||
-u "gwSPoasWSdNkMDtBN3Hu2WYQpPWCO9SwUEsKK22l:fI6ZpfocHYBGfm1tP92r0yIgCyfRdDQt0Tos9L8a4fNsJjQQMwp9569eIaUBsaVDgt2eiwOGe0bg5m5vCSstClZmtdy359RVx2rQK5YlIWyPlrolpt2LEpVeKXWaiybo" \
|
||||
http://<awx>/api/o/token/ -i
|
||||
```
|
||||
In the above post request, `refresh_token` is provided by `refresh_token` field of the access token
|
||||
In the above POST request, `refresh_token` is provided by `refresh_token` field of the access token
|
||||
above. The authentication information is of format `<client_id>:<client_secret>`, where `client_id`
|
||||
and `client_secret` are the corresponding fields of underlying related application of the access token.
|
||||
|
||||
@@ -364,12 +371,14 @@ Strict-Transport-Security: max-age=15768000
|
||||
```
|
||||
Internally, the refresh operation deletes the existing token and a new token is created immediately
|
||||
after, with information like scope and related application identical to the original one. We can
|
||||
verify by checking the new token is present and the old token is deleted at the /api/v2/tokens/ endpoint.
|
||||
verify by checking the new token is present and the old token is deleted at the `/api/v2/tokens/` endpoint.
|
||||
|
||||
#### Revoke an access token
|
||||
|
||||
##### Alternatively Revoke using the /api/o/revoke-token/ endpoint
|
||||
Revoking an access token by this method is the same as deleting the token resource object, but it allows you to delete a token by providing its token value, and the associated `client_id` (and `client_secret` if the application is `confidential`). For example:
|
||||
#### Revoke an Access Token
|
||||
|
||||
##### Alternatively Revoke Using the /api/o/revoke-token/ Endpoint
|
||||
|
||||
Revoking an access token by this method is the same as deleting the token resource object, but it allows you to delete a token by providing its token value, and the associated `client_id` (and `client_secret` if the application is `confidential`). For example:
|
||||
```bash
|
||||
curl -X POST -d "token=rQONsve372fQwuc2pn76k3IHDCYpi7" \
|
||||
-u "gwSPoasWSdNkMDtBN3Hu2WYQpPWCO9SwUEsKK22l:fI6ZpfocHYBGfm1tP92r0yIgCyfRdDQt0Tos9L8a4fNsJjQQMwp9569eIaUBsaVDgt2eiwOGe0bg5m5vCSstClZmtdy359RVx2rQK5YlIWyPlrolpt2LEpVeKXWaiybo" \
|
||||
@@ -377,17 +386,12 @@ curl -X POST -d "token=rQONsve372fQwuc2pn76k3IHDCYpi7" \
|
||||
```
|
||||
`200 OK` means a successful delete.
|
||||
|
||||
We can verify the effect by checking if the token is no longer present
|
||||
at /api/v2/tokens/.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
We can verify the effect by checking if the token is no longer present
|
||||
at `/api/v2/tokens/`.
|
||||
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
* All CRUD operations for OAuth 2 applications and tokens should function as described.
|
||||
* RBAC rules applied to OAuth 2 applications and tokens should behave as described.
|
||||
* A default application should be auto-created for each new user.
|
||||
@@ -396,4 +400,4 @@ at /api/v2/tokens/.
|
||||
* Token scope mask over RBAC should work as described.
|
||||
* Tower configuration setting `OAUTH2_PROVIDER` should be configurable and function as described.
|
||||
* `/api/o/` endpoint should work as expected. In specific, all examples given in the description
|
||||
help text should be working (user following the steps should get expected result).
|
||||
help text should be working (a user following the steps should get expected result).
|
||||
|
||||
@@ -1,20 +1,23 @@
|
||||
# SAML
|
||||
Security Assertion Markup Language, or SAML, is an open standard for exchanging authentication and/or authorization data between an identity provider (i.e. LDAP) and a service provider (i.e. AWX). More concretely, AWX can be configured to talk with SAML in order to authenticate (create/login/logout) users of AWX. User Team and Organization membership can be embedded in the SAML response to AWX.
|
||||
Security Assertion Markup Language, or SAML, is an open standard for exchanging authentication and/or authorization data between an identity provider (*i.e.*, LDAP) and a service provider (*i.e.*, AWX). More concretely, AWX can be configured to talk with SAML in order to authenticate (create/login/logout) users of AWX. User Team and Organization membership can be embedded in the SAML response to AWX.
|
||||
|
||||
|
||||
# Configure SAML Authentication
|
||||
Please see the Tower documentation as well as Ansible blog posts for basic SAML configuration. Note that AWX's SAML implementation relies on python-social-auth which uses python-saml. AWX exposes 3 fields that are directly passed to the lower libraries:
|
||||
Please see the [Tower documentation](https://docs.ansible.com/ansible-tower/latest/html/administration/ent_auth.html#saml-authentication-settings) as well as the [Ansible blog post](https://www.ansible.com/blog/using-saml-with-red-hat-ansible-tower) for basic SAML configuration. Note that AWX's SAML implementation relies on `python-social-auth` which uses `python-saml`. AWX exposes three fields which are directly passed to the lower libraries:
|
||||
* `SOCIAL_AUTH_SAML_SP_EXTRA` is passed to the `python-saml` library configuration's `sp` setting.
|
||||
* `SOCIAL_AUTH_SAML_SECURITY_CONFIG` is passed to the `python-saml` library configuration's `security` setting.
|
||||
* `SOCIAL_AUTH_SAML_EXTRA_DATA`
|
||||
See http://python-social-auth-docs.readthedocs.io/en/latest/backends/saml.html#advanced-settings for more information.
|
||||
|
||||
# Configure SAML for Team and Organization Membership
|
||||
AWX can be configured to look for particular attributes that contain AWX Team and Organization membership to associate with users when they login to AWX. The attribute names are defined in AWX settings. Specifically, the authentication settings tab and SAML sub category fields *SAML Team Attribute Mapping* and *SAML Organization Attribute Mapping*. The meaning and usefulness of these settings is best motivated through example.
|
||||
|
||||
**Example SAML Organization Attribute Mapping**
|
||||
# Configure SAML for Team and Organization Membership
|
||||
AWX can be configured to look for particular attributes that contain AWX Team and Organization membership to associate with users when they log in to AWX. The attribute names are defined in AWX settings. Specifically, the authentication settings tab and SAML sub category fields *SAML Team Attribute Mapping* and *SAML Organization Attribute Mapping*. The meaning and usefulness of these settings is best communicated through example.
|
||||
|
||||
### Example SAML Organization Attribute Mapping
|
||||
|
||||
Below is an example SAML attribute that embeds user organization membership in the attribute *member-of*.
|
||||
```
|
||||
<saml2:AttributeStatement>
|
||||
<saml2:AttributeStatement>
|
||||
<saml2:Attribute FriendlyName="member-of" Name="member-of" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
|
||||
<saml2:AttributeValue>Engineering</saml2:AttributeValue>
|
||||
<saml2:AttributeValue>IT</saml2:AttributeValue>
|
||||
@@ -25,9 +28,9 @@ Below is an example SAML attribute that embeds user organization membership in t
|
||||
<saml2:AttributeValue>IT</saml2:AttributeValue>
|
||||
<saml2:AttributeValue>HR</saml2:AttributeValue>
|
||||
</saml2:Attribute>
|
||||
</saml2:AttributeStatement>
|
||||
</saml2:AttributeStatement>
|
||||
```
|
||||
Below, the corresponding AWX configuration.
|
||||
Below, the corresponding AWX configuration:
|
||||
```
|
||||
{
|
||||
"saml_attr": "member-of",
|
||||
@@ -36,16 +39,16 @@ Below, the corresponding AWX configuration.
|
||||
'remove_admins': true
|
||||
}
|
||||
```
|
||||
**saml_attr:** The saml attribute name where the organization array can be found.
|
||||
**saml_attr:** The SAML attribute name where the organization array can be found.
|
||||
|
||||
**remove:** True to remove user from all organizations before adding the user to the list of Organizations. False to keep the user in whatever Organization(s) they are in while adding the user to the Organization(s) in the SAML attribute.
|
||||
**remove:** Set this to `true` to remove a user from all organizations before adding the user to the list of Organizations. Set it to `false` to keep the user in whatever Organization(s) they are in while adding the user to the Organization(s) in the SAML attribute.
|
||||
|
||||
**saml_admin_attr:** The saml attribute name where the organization administrators array can be found.
|
||||
**saml_admin_attr:** The SAML attribute name where the organization administrators' array can be found.
|
||||
|
||||
**remove_admins:** True to remove user from all organizations that it is admin before adding the user to the list of Organizations admins. False to keep the user in whatever Organization(s) they are in as admin while adding the user as an Organization administrator in the SAML attribute.
|
||||
**remove_admins:** Set this to `true` to remove a user from all organizations that they are administrators of before adding the user to the list of Organizations admins. Set it to `false` to keep the user in whatever Organization(s) they are in as admin while adding the user as an Organization administrator in the SAML attribute.
|
||||
|
||||
**Example SAML Team Attribute Mapping**
|
||||
Below is another example of a SAML attribute that contains a Team membership in a list.
|
||||
### Example SAML Team Attribute Mapping
|
||||
Below is another example of a SAML attribute that contains a Team membership in a list:
|
||||
```
|
||||
<saml:AttributeStatement>
|
||||
<saml:Attribute
|
||||
@@ -78,8 +81,8 @@ Below is another example of a SAML attribute that contains a Team membership in
|
||||
]
|
||||
}
|
||||
```
|
||||
**saml_attr:** The saml attribute name where the team array can be found.
|
||||
**saml_attr:** The SAML attribute name where the team array can be found.
|
||||
|
||||
**remove:** True to remove user from all Teams before adding the user to the list of Teams. False to keep the user in whatever Team(s) they are in while adding the user to the Team(s) in the SAML attribute.
|
||||
**remove:** Set this to `true` to remove user from all Teams before adding the user to the list of Teams. Set this to `false` to keep the user in whatever Team(s) they are in while adding the user to the Team(s) in the SAML attribute.
|
||||
|
||||
**team_org_map:** An array of dictionaries of the form `{ "team": "<AWX Team Name>", "organization": "<AWX Org Name>" }` that defines mapping from AWX Team -> AWX Organization. This is needed because the same named Team can exist in multiple Organizations in Tower. The organization to which a team listed in a SAML attribute belongs to would be ambiguous without this mapping.
|
||||
**team_org_map:** An array of dictionaries of the form `{ "team": "<AWX Team Name>", "organization": "<AWX Org Name>" }` which defines mapping from AWX Team -> AWX Organization. This is needed because the same named Team can exist in multiple Organizations in Tower. The organization to which a team listed in a SAML attribute belongs to would be ambiguous without this mapping.
|
||||
|
||||
Reference in New Issue
Block a user