fix(SSO): JWK関数の仕様変更に対応 (MisskeyIO#959)
MisskeyIO#950
This commit is contained in:
parent
cf1151aa28
commit
eb5e94dbf8
5 changed files with 13 additions and 10 deletions
|
@ -123,7 +123,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
}
|
||||
|
||||
const { publicKey, privateKey } = ps.useCertificate
|
||||
? await jose.generateKeyPair(ps.signatureAlgorithm).then(async keypair => ({
|
||||
? await jose.generateKeyPair(ps.signatureAlgorithm, { extractable: true }).then(async keypair => ({
|
||||
publicKey: JSON.stringify(await jose.exportJWK(keypair.publicKey)),
|
||||
privateKey: JSON.stringify(await jose.exportJWK(keypair.privateKey)),
|
||||
}))
|
||||
|
@ -139,6 +139,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
tenYearsLaterTime,
|
||||
publicKey,
|
||||
privateKey ?? '',
|
||||
ps.signatureAlgorithm,
|
||||
) : undefined;
|
||||
|
||||
const ssoServiceProvider = await this.singleSignOnServiceProviderRepository.insert({
|
||||
|
|
|
@ -60,7 +60,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
|
||||
const alg = ps.signatureAlgorithm ? ps.signatureAlgorithm : service.signatureAlgorithm;
|
||||
const { publicKey, privateKey } = ps.regenerateCertificate
|
||||
? await jose.generateKeyPair(alg).then(async keypair => ({
|
||||
? await jose.generateKeyPair(alg, { extractable: true }).then(async keypair => ({
|
||||
publicKey: JSON.stringify(await jose.exportJWK(keypair.publicKey)),
|
||||
privateKey: JSON.stringify(await jose.exportJWK(keypair.privateKey)),
|
||||
}))
|
||||
|
@ -76,6 +76,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
tenYearsLaterTime,
|
||||
publicKey ?? '',
|
||||
privateKey ?? '',
|
||||
alg,
|
||||
) : undefined;
|
||||
|
||||
await this.singleSignOnServiceProviderRepository.update(service.id, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue