Error

Using this IndieAuth endpoint

To use this authentication endpoint, add the following values to your website’s <head>:

<link rel="authorization_endpoint" href="https://api.giacomodebidda.com/auth">
<link rel="token_endpoint" href="https://api.giacomodebidda.com/auth/token">
<link rel="indieauth-metadata" href="https://api.giacomodebidda.com/.well-known/oauth-authorization-server">

Get a user’s identity

Request an authorization code

GET https://api.giacomodebidda.com/auth
Content-type: application/x-www-form-urlencoded

response_type=code
&client_id=https://api.giacomodebidda.com
&redirect_uri=https://api.giacomodebidda.com/session/auth
&code_challenge=xxxxxxxxxx
&code_challenge_method=S256
&state=1234567890
&scope=create+delete+update

If the user approves the request, the endpoint will generate an authorization code and redirect back to the client:

HTTP/1.1 302 Found
Location: https://api.giacomodebidda.com/session/auth?code=xxxxxxxx
  &state=1234567890
  &iss=https://api.giacomodebidda.com

Redeem an authorization code for a user’s profile URL

POST https://api.giacomodebidda.com/auth
Content-type: application/x-www-form-urlencoded
Accept: application/json

grant_type=authorization_code
&code=xxxxxxxxxx
&client_id=https://api.giacomodebidda.com
&redirect_uri=https://api.giacomodebidda.com/session/auth
&code_verifier=xxxxxxxxxx
HTTP/1.1 200 OK
Content-Type: application/json

{
  "me": "https://giacomodebidda.com"
}

Get a user’s access permissions

Redeem an authorization code for an access token

POST https://api.giacomodebidda.com/auth/token
Content-type: application/x-www-form-urlencoded
Accept: application/json

grant_type=authorization_code
&code=xxxxxxxxxx
&client_id=https://api.giacomodebidda.com
&redirect_uri=https://api.giacomodebidda.com/session/auth
&code_verifier=xxxxxxxxxx
HTTP/1.1 200 OK
Content-Type: application/json

{
  "access_token": "xxxxxxxxxx",
  "token_type": "Bearer",
  "me": "https://giacomodebidda.com",
  "scope": "create delete update"
}

Verify an access token

POST https://api.giacomodebidda.com/auth/introspect
Content-type: application/x-www-form-urlencoded
Accept: application/json
Authorization: Bearer xxxxxxxx

token=xxxxxxxx
HTTP/1.1 200 OK
Content-Type: application/json

{
  "active": true,
  "client_id": "https://api.giacomodebidda.com",
  "me": "https://giacomodebidda.com",
  "scope": "create delete update",
  "iat": 1668682284,
  "exp": 1676458284
}