mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 06:03:34 +01:00
chore: add docs how to obtain bearer token (#6328)
* chore: add docs how to obtain bearer token * Added configurable ttl to settings --------- Co-authored-by: SamTV12345 <40429738+samtv12345@users.noreply.github.com>
This commit is contained in:
parent
70a536cad1
commit
8a76d2c680
5 changed files with 39 additions and 9 deletions
|
@ -161,7 +161,7 @@ Responses are valid JSON in the following format:
|
||||||
|
|
||||||
### Authentication
|
### Authentication
|
||||||
|
|
||||||
Authentication works via an OAuth token that is sent with each request as a post parameter. You can add new clients that can sign in via the API by adding new entries to the sso section in the settings.json.
|
Authentication works via an OAuth token that is sent with each request as an Authorization header, i.e. `Authorization: Bearer YOUR_TOKEN`. You can add new clients that can sign in via the API by adding new entries to the sso section in the settings.json.
|
||||||
|
|
||||||
|
|
||||||
#### Example for browser login clients
|
#### Example for browser login clients
|
||||||
|
@ -200,6 +200,10 @@ E.g. a service that creates a pad for a user or a service that inserts a text in
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Obtain a Bearer token:
|
||||||
|
|
||||||
|
`curl --request POST --url 'https://your.server.tld/oidc/token' --header 'content-type: application/x-www-form-urlencoded' --data grant_type=client_credentials --data client_id=client_credentials --data client_secret=client_credentials`
|
||||||
|
|
||||||
|
|
||||||
### Node Interoperability
|
### Node Interoperability
|
||||||
|
|
||||||
|
|
|
@ -669,5 +669,16 @@
|
||||||
"redirect_uris": ["${USER_REDIRECT:http://localhost:9001/}"]
|
"redirect_uris": ["${USER_REDIRECT:http://localhost:9001/}"]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
|
||||||
|
/* Set the time to live for the tokens
|
||||||
|
This is the time of seconds a user is logged into Etherpad
|
||||||
|
"ttl": {
|
||||||
|
"AccessToken": 3600,
|
||||||
|
"AuthorizationCode": 600,
|
||||||
|
"ClientCredentials": 3600,
|
||||||
|
"IdToken": 3600,
|
||||||
|
"RefreshToken": 86400
|
||||||
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
|
@ -671,4 +671,15 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Set the time to live for the tokens
|
||||||
|
This is the time of seconds a user is logged into Etherpad
|
||||||
|
"ttl": {
|
||||||
|
"AccessToken": 3600,
|
||||||
|
"AuthorizationCode": 600,
|
||||||
|
"ClientCredentials": 3600,
|
||||||
|
"IdToken": 3600,
|
||||||
|
"RefreshToken": 86400
|
||||||
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,13 +47,7 @@ const configuration: Configuration = {
|
||||||
} as Account
|
} as Account
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ttl:{
|
ttl: settings.ttl,
|
||||||
AccessToken: 1 * 60 * 60, // 1 hour in seconds
|
|
||||||
AuthorizationCode: 10 * 60, // 10 minutes in seconds
|
|
||||||
ClientCredentials: 1 * 60 * 60, // 1 hour in seconds
|
|
||||||
IdToken: 1 * 60 * 60, // 1 hour in seconds
|
|
||||||
RefreshToken: 1 * 24 * 60 * 60, // 1 day in seconds
|
|
||||||
},
|
|
||||||
claims: {
|
claims: {
|
||||||
openid: ['sub'],
|
openid: ['sub'],
|
||||||
email: ['email'],
|
email: ['email'],
|
||||||
|
|
|
@ -98,6 +98,16 @@ exports.title = 'Etherpad';
|
||||||
*/
|
*/
|
||||||
exports.favicon = null;
|
exports.favicon = null;
|
||||||
|
|
||||||
|
exports.ttl = {
|
||||||
|
AccessToken: 1 * 60 * 60, // 1 hour in seconds
|
||||||
|
AuthorizationCode: 10 * 60, // 10 minutes in seconds
|
||||||
|
ClientCredentials: 1 * 60 * 60, // 1 hour in seconds
|
||||||
|
IdToken: 1 * 60 * 60, // 1 hour in seconds
|
||||||
|
RefreshToken: 1 * 24 * 60 * 60, // 1 day in seconds
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Skin name.
|
* Skin name.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue