Using this IndieAuth endpoint
To use this authentication endpoint, add the following values to your website’s <head>:
<link rel="authorization_endpoint" href="https://indie.tsmd.jp/auth">
<link rel="token_endpoint" href="https://indie.tsmd.jp/auth/token">
<link rel="indieauth-metadata" href="https://indie.tsmd.jp/.well-known/oauth-authorization-server">
Get a user’s identity
Request an authorization code
GET https://indie.tsmd.jp/auth
Content-type: application/x-www-form-urlencoded
response_type=code
&client_id=https://indie.tsmd.jp
&redirect_uri=https://indie.tsmd.jp/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://indie.tsmd.jp/session/auth?code=xxxxxxxx
&state=1234567890
&iss=https://indie.tsmd.jp
Redeem an authorization code for a user’s profile URL
POST https://indie.tsmd.jp/auth
Content-type: application/x-www-form-urlencoded
Accept: application/json
grant_type=authorization_code
&code=xxxxxxxxxx
&client_id=https://indie.tsmd.jp
&redirect_uri=https://indie.tsmd.jp/session/auth
&code_verifier=xxxxxxxxxx
HTTP/1.1 200 OK
Content-Type: application/json
{
"me": "https://tsmd.jp"
}
Get a user’s access permissions
Redeem an authorization code for an access token
POST https://indie.tsmd.jp/auth/token
Content-type: application/x-www-form-urlencoded
Accept: application/json
grant_type=authorization_code
&code=xxxxxxxxxx
&client_id=https://indie.tsmd.jp
&redirect_uri=https://indie.tsmd.jp/session/auth
&code_verifier=xxxxxxxxxx
HTTP/1.1 200 OK
Content-Type: application/json
{
"access_token": "xxxxxxxxxx",
"token_type": "Bearer",
"me": "https://tsmd.jp",
"scope": "create delete update"
}
Verify an access token
POST https://indie.tsmd.jp/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://indie.tsmd.jp",
"me": "https://tsmd.jp",
"scope": "create delete update",
"iat": 1668682284,
"exp": 1676458284
}