add a parameter for oauth2 token signature algorithm
This commit is contained in:
parent
b705d79bdc
commit
edd9f2482a
@ -110,6 +110,14 @@ async function register ({
|
|||||||
descriptionHTML: 'Will only allow login for users whose group array contains this group'
|
descriptionHTML: 'Will only allow login for users whose group array contains this group'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
registerSetting({
|
||||||
|
name: 'signature-algorithm',
|
||||||
|
label: 'Token signature algorithm',
|
||||||
|
type: 'input',
|
||||||
|
private: true,
|
||||||
|
default: 'RS256'
|
||||||
|
})
|
||||||
|
|
||||||
const router = getRouter()
|
const router = getRouter()
|
||||||
router.use('/code-cb', (req, res) => handleCb(peertubeHelpers, settingsManager, req, res))
|
router.use('/code-cb', (req, res) => handleCb(peertubeHelpers, settingsManager, req, res))
|
||||||
|
|
||||||
@ -159,7 +167,8 @@ async function loadSettingsAndCreateClient (registerExternalAuth, unregisterExte
|
|||||||
'scope',
|
'scope',
|
||||||
'discover-url',
|
'discover-url',
|
||||||
'client-id',
|
'client-id',
|
||||||
'client-secret'
|
'client-secret',
|
||||||
|
'signature-algorithm'
|
||||||
])
|
])
|
||||||
|
|
||||||
if (!settings['discover-url']) {
|
if (!settings['discover-url']) {
|
||||||
@ -180,7 +189,9 @@ async function loadSettingsAndCreateClient (registerExternalAuth, unregisterExte
|
|||||||
const clientOptions = {
|
const clientOptions = {
|
||||||
client_id: settings['client-id'],
|
client_id: settings['client-id'],
|
||||||
redirect_uris: [ store.redirectUrl ],
|
redirect_uris: [ store.redirectUrl ],
|
||||||
response_types: [ 'code' ]
|
response_types: [ 'code' ],
|
||||||
|
id_token_signed_response_alg: settings['signature-algorithm'],
|
||||||
|
authorization_signed_response_alg: settings['signature-algorithm']
|
||||||
}
|
}
|
||||||
|
|
||||||
if (settings['client-secret']) {
|
if (settings['client-secret']) {
|
||||||
|
Loading…
Reference in New Issue
Block a user