# What happens with user directly access the Authgear Endpoint?

Normally, the user should access the signup/login page through an OIDC flow, via the SDK or SAML. In such cases, the user will be redirected to the application specified by the flow.

Use the Endpoint Direct Access settings to configure what happens when users directly visit the endpoint URL (e.g. `https://my-project.authgear.cloud`) of an Authgear project unexpectedly.

By default, when users access the endpoint of a project directly, they'll see an error page that looks like this:

<figure><img src="/files/VRt8t0Y48CiFR2ibcreW" alt="" width="375"><figcaption></figcaption></figure>

## Show a "Back to home" link

Instead of the default error message, you can show a link to redirect the user away under your logo and project name. Go to **Advanced** > **Endpoint Direct Access,** select "**Show a simple brand page with a back to home link**" and provide the link.

<figure><img src="/files/MBY4t3Jl4dxb7i7Z8S4P" alt="" width="375"><figcaption><p>Show a link under your logo and project name</p></figcaption></figure>

## Cookie-based Authentication

If you are using [Cookie-based authentication](#cookie-based-authentication), you can set Authgear to render the signup/login page even when the user is accessing the Endpoint URL directly. And therefore these options are only available when [custom domain](/customization/custom-domain.md) is enabled.

When user access the endpoint directly, they will be redirected to the `/login` page. After login, the user will be directed to the [User Settings](/customization/built-in-ui/user-settings.md) page (`/settings`).

{% hint style="info" %}
This is only applicable for cookie-based authentication. If you integrate Authgear with the SDKs, OIDC or SAML protocols, the user should not access the endpoint URL directly in their browser. The authentication should be triggered from the flows.
{% endhint %}

### **Show the login page and redirect to the hosted settings page**

When the user accesses the endpoint URL directly in their browser, show the authentication page. After the user is authenticated, they are redirected to the hosted [User Settings](/customization/built-in-ui/user-settings.md) page which they can manage their account.

### **Show the login page and redirect to a custom URL**

When the user accesses the endpoint URL directly in their browser, show the authentication page. After the user is authenticated, they are redirected to a custom URL, which is usually your application website.

## Post-logout URL

You should use the logout function in the SDK, the end-session endpoint for OIDC integration and Logout URL for SAML integration, in which the post-logout behaviour are specified according to the flows.

But if the user directly accesses the logout page, e.g. `https://myproject.authgear.cloud/logout`, the Post-Logout URL in Endpoint Direct Access settings controls where Authgear will redirect users after logout.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.authgear.com/integration/faq-for-integration/directly-accessing-authgear-endpoint.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
