m1yag1.globus.globus_auth module – Manage Globus Auth resources (projects, clients, and policies)
Note
This module is part of the m1yag1.globus collection (version 0.6.0).
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install m1yag1.globus.
To use it in a playbook, specify: m1yag1.globus.globus_auth.
New in m1yag1.globus 1.0.0
Synopsis
Create and update Globus Auth projects and OAuth clients
Manage authentication policies for projects
Configure project membership and access controls
Requires manage_projects scope
NOTE: Deletion of projects and OAuth clients currently requires high-assurance authentication (MFA within 30 minutes) and must be done manually via https://app.globus.org/settings/developers. This is a known issue in Globus Auth that may be resolved in the future.
Parameters
Parameter |
Comments |
|---|---|
List of Globus group IDs for project administrators (project only) |
|
List of Globus identity IDs for project administrators (project only) |
|
Authentication method to use. If not specified, auto-detects based on available credentials. When Otherwise falls back to Choices:
|
|
Timeout in seconds for authentication assurance (policy only) |
|
Globus Auth client ID for client_credentials authentication. Can also be set via the |
|
Globus Auth client secret for client_credentials authentication. Can also be set via the |
|
Type of OAuth client to create (client only) Choices:
|
|
Contact email (project only) |
|
Path to save client credentials JSON file (client only) |
|
Description of the resource |
|
List of prohibited authentication domains (policy only) |
|
List of allowed authentication domains (policy only) |
|
Require high assurance authentication (policy only) Choices:
|
|
Name/identifier for the resource (display_name for projects, display_name for policies) |
|
Pre-selected identity provider UUID (client only) |
|
URL to privacy policy (client only) |
|
Project ID (required for policy resources) |
|
List of OAuth redirect URIs (client only) |
|
Required identity provider UUID (client only) |
|
ID of existing resource (project_id or policy_id for updates) |
|
Type of auth resource to manage Choices:
|
|
List of scope strings the client is allowed to request (client only) |
|
Desired state of the resource Choices:
|
|
URL to terms and conditions (client only) |
|
Client visibility (client only) Choices:
|
Notes
Note
Authentication is required for all Globus API operations.
For
client_credentialsauth, register a confidential client at https://developers.globus.org.For
cliauth, runglobus loginfirst to cache tokens.The
climethod reads tokens from~/.globus/cli/storage.db.For
cliauth with multiple profiles, setGLOBUS_PROFILEenvironment variable.Set
GLOBUS_SDK_ENVIRONMENTtosandboxortestfor non-production environments.
See Also
See also
- Globus Auth Documentation
Official Globus authentication documentation
- Globus CLI
Command-line interface for Globus
Examples
# Project Management
- name: Create a Globus Auth project
globus_auth:
resource_type: project
name: "Research Data Project"
contact_email: "admin@example.org"
description: "Project for managing research data transfers"
admin_ids:
- "ae341a98-d274-11e5-b888-dbae3a8ba545"
state: present
- name: Update project administrators
globus_auth:
resource_type: project
name: "Research Data Project"
admin_ids:
- "ae341a98-d274-11e5-b888-dbae3a8ba545"
- "b1234567-d274-11e5-b888-dbae3a8ba545"
admin_group_ids:
- "c7890abc-d274-11e5-b888-dbae3a8ba545"
state: present
# NOTE: Project deletion currently requires high-assurance authentication (MFA within 30 min)
# due to a known bug in Globus Auth. This may be resolved in a future release.
# For now, projects must be deleted manually at https://app.globus.org/settings/developers
# state: absent is temporarily not supported for projects
# Policy Management
- name: Create high assurance policy for project
globus_auth:
resource_type: policy
project_id: "abc123-def456-ghi789"
name: "High Security Policy"
description: "Requires high assurance authentication"
high_assurance: true
authentication_assurance_timeout: 3600
state: present
- name: Create domain-restricted policy
globus_auth:
resource_type: policy
project_id: "abc123-def456-ghi789"
name: "University Only Policy"
description: "Only allow university domains"
domain_constraints_include:
- "university.edu"
- "research.org"
domain_constraints_exclude:
- "gmail.com"
state: present
- name: Delete a policy
globus_auth:
resource_type: policy
project_id: "abc123-def456-ghi789"
name: "Old Policy"
state: absent
# Client Management
- name: Create service account (confidential client)
globus_auth:
resource_type: client
name: "Automation Service Account"
project_id: "abc123-def456-ghi789"
client_type: "confidential_client"
redirect_uris:
- "https://myapp.example.com/callback"
visibility: "private"
state: present
register: service_account
no_log: true # Important: credentials contain secrets
- name: Display client credentials (WARNING: Contains secrets!)
ansible.builtin.debug:
msg:
- "Client ID: {{ service_account.client_id }}"
- "Client Secret: {{ service_account.client_secret }}"
- "SAVE THESE CREDENTIALS NOW - Secret cannot be retrieved later!"
- name: Create service account with credential file output
globus_auth:
resource_type: client
name: "Automation Service Account"
project_id: "abc123-def456-ghi789"
client_type: "confidential_client"
redirect_uris:
- "https://myapp.example.com/callback"
credential_output_file: "/secure/path/client-credentials.json"
state: present
register: service_account
- name: Create thick client (public installed client)
globus_auth:
resource_type: client
name: "Desktop Application"
project_id: "abc123-def456-ghi789"
client_type: "public_installed_client"
redirect_uris:
- "https://auth.globus.org/v2/web/auth-code"
visibility: "public"
state: present
- name: Create client identity for automation
globus_auth:
resource_type: client
name: "CI/CD Pipeline"
project_id: "abc123-def456-ghi789"
client_type: "client_identity"
state: present
# NOTE: Client deletion currently requires high-assurance authentication (MFA within 30 min)
# due to a known bug in Globus Auth. This may be resolved in a future release.
# For now, OAuth clients must be deleted manually at https://app.globus.org/settings/developers
# state: absent is temporarily not supported for OAuth clients
# Combined workflow
- name: Create project with policy
block:
- name: Create project
globus_auth:
resource_type: project
name: "Secure Research Project"
contact_email: "admin@university.edu"
description: "High-security research collaboration"
admin_ids:
- "ae341a98-d274-11e5-b888-dbae3a8ba545"
state: present
register: project
- name: Create security policy for project
globus_auth:
resource_type: policy
project_id: "{{ project.resource_id }}"
name: "Strict Security Policy"
description: "High assurance with domain restrictions"
high_assurance: true
authentication_assurance_timeout: 1800
domain_constraints_include:
- "university.edu"
state: present
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Whether the resource was changed Returned: always |
|
Complete client credentials in multiple formats Returned: when resource_type=client and state=present |
|
Ansible environment variable format Returned: success |
|
OAuth client ID Returned: success |
|
OAuth client secret (if applicable) Returned: success |
|
Path to saved JSON file (if credential_output_file was specified) Returned: success |
|
Shell export command format Returned: success |
|
OAuth client ID (for clients) Returned: when resource_type=client and state=present |
|
OAuth client secret (for confidential clients) Returned: when resource_type=client and state=present and client has secret |
|
Name of the resource Returned: always |
|
Associated project ID (for policies and clients) Returned: when resource_type in [policy, client] |
|
ID of the created/managed resource Returned: when state=present |
|
Type of resource (project, policy, or client) Returned: always |
|
Important warnings about credential management Returned: when resource_type=client and state=present |