fix(SSO/SAML): JWK関数の仕様変更に対応 (MisskeyIO#966)
This commit is contained in:
parent
3bd2b5a048
commit
abc5e05607
2 changed files with 4 additions and 4 deletions
|
@ -18,13 +18,13 @@ export async function genX509CertFromJWK(
|
|||
cert.setSubject(attrs);
|
||||
cert.setIssuer(attrs);
|
||||
cert.publicKey = await jose
|
||||
.importJWK(JSON.parse(publicKey), alg)
|
||||
.importJWK(JSON.parse(publicKey), alg, { extractable: true })
|
||||
.then((k) => jose.exportSPKI(k as jose.CryptoKey))
|
||||
.then((k) => forge.pki.publicKeyFromPem(k));
|
||||
|
||||
cert.sign(
|
||||
await jose
|
||||
.importJWK(JSON.parse(privateKey), alg)
|
||||
.importJWK(JSON.parse(privateKey), alg, { extractable: true })
|
||||
.then((k) => jose.exportPKCS8(k as jose.CryptoKey))
|
||||
.then((k) => forge.pki.privateKeyFromPem(k)),
|
||||
forge.md.sha256.create(),
|
||||
|
|
|
@ -238,7 +238,7 @@ export class SAMLIdentifyProviderService {
|
|||
const idp = saml.IdentityProvider({
|
||||
metadata: await this.createIdPMetadataXml(ssoServiceProvider),
|
||||
privateKey: await jose
|
||||
.importJWK(JSON.parse(ssoServiceProvider.privateKey ?? '{}'), ssoServiceProvider.signatureAlgorithm)
|
||||
.importJWK(JSON.parse(ssoServiceProvider.privateKey ?? '{}'), ssoServiceProvider.signatureAlgorithm, { extractable: true })
|
||||
.then(k => jose.exportPKCS8(k as jose.CryptoKey)),
|
||||
});
|
||||
|
||||
|
@ -392,7 +392,7 @@ export class SAMLIdentifyProviderService {
|
|||
const idp = saml.IdentityProvider({
|
||||
metadata: await this.createIdPMetadataXml(ssoServiceProvider),
|
||||
privateKey: await jose
|
||||
.importJWK(JSON.parse(ssoServiceProvider.privateKey ?? '{}'), ssoServiceProvider.signatureAlgorithm)
|
||||
.importJWK(JSON.parse(ssoServiceProvider.privateKey ?? '{}'), ssoServiceProvider.signatureAlgorithm, { extractable: true })
|
||||
.then(k => jose.exportPKCS8(k as jose.CryptoKey)),
|
||||
loginResponseTemplate: { context: 'ignored' },
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue