Cookie-based (Website or Single-page app)

Authenticate incoming request by cookie in the HTTP header.

By using Authgear, you can add a login to your website easily. Authgear supports various authentication methods, that you can easily turn on and configure in the portal.

Prerequisites

To authenticate with cookies, you will need to set up a custom domain for Authgear, so that your website and Authgear are under the same root domains. e.g. Your website is yourdomain.com, and Authgear with a custom domain auth.yourdomain.com.

In this setting, if you have multiple applications under yourdomain.com, all applications would share the same session cookies automatically.

Overview

How it works

Your app server will receive a request with the cookie

Verify request in your app server

To verify the requests in your app server, you must Forward authentication to Authgear Resolver Endpoint.

Forwarding authentication to Authgear Resolver Endpoint

Request example

> GET /api_path HTTP/1.1
> Host: yourdomain.com
> cookie: session=<AUTHGEAR_SESSION_ID>

Get Started

The following tutorials show you how to add user login to your website using Authgear.

1. Frontend Integration

JavaScript (Web)

2. Backend Integration

Backend Integration

Last updated

#311: Include export users api in api reference doc page

Change request updated