Cloudflare Access Integration
Organizations using Cloudflare Zero Trust can let members sign in to MaiAgent through Cloudflare Access. This guide covers configuration fields (Team Name, AUD Tag, email domain, and automatic member
If your company already uses Cloudflare Zero Trust Access to manage access to internal systems, you can configure Cloudflare Access as a third-party sign-in method for MaiAgent. After members open the sign-in link, they authenticate through Cloudflare Access (and any identity provider your company has connected to Access), then automatically sign in to MaiAgent.
Who this is for: Enterprises that already use Cloudflare Zero Trust Access and want to keep using the same sign-in and access policies.
Requirements
Your organization must be on an Enterprise plan. Organizations on other plans do not see Third-party Sign-in Settings under Management Actions.
Only the organization owner can save authentication settings.
Each organization can use only one authentication type at a time. For the effects of switching, see Switching Authentication Types.
How It Works
A member opens the sign-in link generated by MaiAgent.
MaiAgent redirects the member to the Server URL you configured: the entry URL protected by Cloudflare Access.
Cloudflare Access intercepts the request and requires the member to sign in according to your company's Access policies.
After successful authentication, Cloudflare forwards the request with an identity token to MaiAgent. MaiAgent uses the Team Name to retrieve Cloudflare's public keys, verify the signature, and check the Application Audience (AUD) Tag.
MaiAgent finds the account matching the email address in the token (or creates one automatically, depending on your settings), and the member is signed in to MaiAgent.
Prerequisites
Prepare the following information in Cloudflare Zero Trust:
Team Name
Your Zero Trust team name. If your team domain is acme.cloudflareaccess.com, the team name is acme
Access Application
The Access application that protects the entry URL. The sign-in callback path is /api/auth/cloudflare/<認證來源名稱>/callback/. This path must be protected by the application, and requests must be forwarded to MaiAgent
AUD Tag
The Application Audience (AUD) Tag of the Access Application above
Configure in MaiAgent
In the left menu, click Organization Settings → Organization Overview, then click Third-party Sign-in Settings in the Management Actions section.
Select Cloudflare Access from the authentication type cards. The Cloudflare Access Settings section appears below.
Fill in the fields in the table below and click Save. The Confirm Authentication Method Change dialog appears. Read the notes, then click Confirm Change.
Authentication Source Name
Yes
A unique name that identifies this authentication source and becomes part of the sign-in link. Use only lowercase English letters, numbers, and hyphens (-), up to 31 characters. maiagent is not allowed. The rules are the same as for other authentication types; see Authentication Source Naming Rules
Server URL
Yes
The entry URL protected by Cloudflare Access, such as https://portal.acme.com
Team Name
Yes
Your Cloudflare Zero Trust team name, such as acme
Application Audience (AUD) Tag
Yes
The AUD Tag of the Access Application
Email Domain
No
When set, only email addresses in this domain, such as acme.com, can sign in through this authentication source. The same domain cannot also be used by another organization's authentication source
Sign-in Link
After you save, a Sign-in URL is generated in the Sign-in Link section. Copy it and share it with members so they can open the link to sign in through Cloudflare Access. Before you save, the page displays “Save your settings first. The system will then generate a sign-in link automatically.”
Account Matching
MaiAgent matches accounts using the email address verified by Cloudflare and determines whether to allow sign-in based on Automatically Create Members:
Already a member of this organization
Sign in
Sign in
Has a MaiAgent account but is not a member of this organization
Deny sign-in
Add to this organization and sign in
Does not yet have a MaiAgent account
Deny sign-in
Create an account, add to this organization, and sign in; the display name defaults to the part of the email address before @
Email address is outside the configured email domain
Deny sign-in
Deny sign-in
Members who already have a MaiAgent account can continue using their existing sign-in methods, such as a username and password. Cloudflare Access provides an additional way to sign in.
Sign-in Error Messages
Authentication failed. Please sign in again
The request is missing Cloudflare's identity token, or token verification failed (Team Name or AUD Tag mismatch)
Confirm that the callback path is protected by the Access Application and that both fields match the values in Cloudflare
This account is not authorized to access this organization
The account is not a member of this organization and automatic member creation is off, or the email address is outside the configured domain
Add the member to the organization first, or enable Automatically Create Members
This sign-in method is currently disabled
Sign-in through this authentication source has been disabled
Contact your MaiAgent representative
Sign-in timed out. Please sign in again
The one-time sign-in code has already been used or has expired, for example after refreshing the page during sign-in
Click Sign In Again and try again
Sign-in was not completed. Please sign in again
The callback page was opened directly (without Cloudflare authentication), or the flow was interrupted
Start again from the URL in the sign-in link card
Frequently Asked Questions
Q: Does signing out of MaiAgent also sign me out of Cloudflare Access?
No. Signing out only ends your MaiAgent session. Your Cloudflare Access session depends on your company's session settings in Cloudflare.
Q: Can I restrict sign-in to colleagues from a specific domain?
Yes. Once you set Email Domain, email addresses from other domains are rejected even if Cloudflare authenticates them. Configure more detailed access rules, such as allowing only certain departments, in Cloudflare Access policies.
Q: Why does saving show “This email domain is already in use”?
Another authentication source already uses this domain. Each domain can be associated with only one authentication source. Use a different domain, or leave the field blank to apply no domain restriction.
Further Reading
Third-party Sign-in (SSO): Overview of authentication types and the effects of switching between them
Member Management: Add members to your organization in advance
Role and Permission Management: Set roles and permissions for members who sign in
Last updated
Was this helpful?