hns-login/README.md

57 lines
1.6 KiB
Markdown
Raw Normal View History

2024-02-09 12:50:43 +11:00
# varo-openid
2024-02-09 23:04:20 +11:00
## Add a client
2024-02-09 23:06:26 +11:00
Go to /create-client and add a new client.
2024-02-13 22:54:42 +11:00
Set the following parameters:
2024-02-09 23:04:20 +11:00
2024-02-13 22:54:42 +11:00
Allowed Scope: `profile`
Allowed Grant Types: `authorization_code`
Allowed Response Types: `code`
2024-02-09 23:04:20 +11:00
Token Endpoint Authentication Method: `client_secret_post`
2024-02-13 22:54:42 +11:00
## Client settings
Set the following parameters:
2024-02-13 22:58:10 +11:00
`Client ID`: Given by the previous step
`Client Secret`: Given by the previous step
`Authorization URL`: `https://login.hns.au/oauth/authorize`
`Token URL`: `https://login.hns.au/oauth/token`
`Userinfo URL`: `https://login.hns.au/api/me`
2024-06-19 14:38:50 +10:00
## Regular auth flow
1. Redirect the user to `https://login.hns.au/auth?return=<return-url>`
2. User logs in and will be returned to `https://<return-url>?username=<username>&token=<token>`
3. Use the token to authenticate the user with `https://login.hns.au/auth/user?token=<token>`
This will return the following json:
```json
{
"displayName": "Nathan.Woodburn/",
"email": "contact@nathan.woodburn.au",
"email_verified": false,
"family_name": "nathan.woodburn",
"given_name": "nathan.woodburn",
"id": 1,
"links": "https://woodburn",
"name": "Nathan.Woodburn/",
"nickname": "Nathan.Woodburn/",
"picture": "https://nathan.woodburn.au/assets/img/profile.png",
"preferred_username": "nathan.woodburn",
"profile": "https://login.hns.au/u/nathan.woodburn",
"sub": 1,
"uid": 1,
"username": "nathan.woodburn",
"website": "https://nathan.woodburn"
}
```
2024-02-13 22:58:10 +11:00
## Deploy your own instance
```bash
docker volume create hns-login
docker run -d -p 9090:9090 --name hns-login -v hns-login:/app/instance git.woodburn.au/nathanwoodburn/hns-login:latest
```
2024-02-13 22:54:42 +11:00