oidc: add clients.tokenSignatureAlgorithm
This commit is contained in:
@@ -14,6 +14,7 @@ const CLIENT_0 = {
|
||||
id: 'client0',
|
||||
name: 'test client 0',
|
||||
secret: 'secret0',
|
||||
tokenSignatureAlgorithm: 'RS256',
|
||||
loginRedirectUri: 'http://foo.bar'
|
||||
};
|
||||
|
||||
@@ -21,6 +22,7 @@ const CLIENT_1 = {
|
||||
id: 'client1',
|
||||
name: 'test client 1',
|
||||
secret: 'secret1',
|
||||
tokenSignatureAlgorithm: 'EdDSA',
|
||||
loginRedirectUri: 'https://cloudron.io/login',
|
||||
logoutRedirectUri: 'https://cloudron.io/logout'
|
||||
};
|
||||
@@ -89,6 +91,7 @@ describe('OpenID connect clients API', function () {
|
||||
expect(response.body.secret).to.equal(CLIENT_1.secret);
|
||||
expect(response.body.loginRedirectUri).to.equal(CLIENT_1.loginRedirectUri);
|
||||
expect(response.body.logoutRedirectUri).to.equal(CLIENT_1.logoutRedirectUri);
|
||||
expect(response.body.tokenSignatureAlgorithm).to.equal(CLIENT_1.tokenSignatureAlgorithm);
|
||||
});
|
||||
|
||||
it('cannot update non-existent client', async function () {
|
||||
@@ -147,7 +150,7 @@ describe('OpenID connect clients API', function () {
|
||||
it('can update client without logoutRedirectUri', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/oidc/clients/${CLIENT_0.id}`)
|
||||
.query({ access_token: owner.token })
|
||||
.send({ secret: 'newsecret', name: 'new name', loginRedirectUri: CLIENT_0.loginRedirectUri })
|
||||
.send({ secret: 'newsecret', name: 'new name', loginRedirectUri: CLIENT_0.loginRedirectUri, tokenSignatureAlgorithm: CLIENT_0.tokenSignatureAlgorithm })
|
||||
.ok(() => true);
|
||||
|
||||
expect(response.statusCode).to.equal(201);
|
||||
@@ -163,7 +166,7 @@ describe('OpenID connect clients API', function () {
|
||||
it('can update client with logoutRedirectUri', async function () {
|
||||
const response = await superagent.post(`${serverUrl}/api/v1/oidc/clients/${CLIENT_0.id}`)
|
||||
.query({ access_token: owner.token })
|
||||
.send({ secret: 'newsecret', name: CLIENT_1.name, loginRedirectUri: CLIENT_0.loginRedirectUri, logoutRedirectUri: CLIENT_1.logoutRedirectUri })
|
||||
.send({ secret: 'newsecret', name: CLIENT_1.name, loginRedirectUri: CLIENT_0.loginRedirectUri, logoutRedirectUri: CLIENT_1.logoutRedirectUri, tokenSignatureAlgorithm: CLIENT_1.tokenSignatureAlgorithm })
|
||||
.ok(() => true);
|
||||
|
||||
expect(response.statusCode).to.equal(201);
|
||||
@@ -175,6 +178,7 @@ describe('OpenID connect clients API', function () {
|
||||
expect(response2.body.secret).to.equal('newsecret');
|
||||
expect(response2.body.loginRedirectUri).to.equal(CLIENT_0.loginRedirectUri);
|
||||
expect(response2.body.logoutRedirectUri).to.equal(CLIENT_1.logoutRedirectUri);
|
||||
expect(response2.body.tokenSignatureAlgorithm).to.equal(CLIENT_1.tokenSignatureAlgorithm);
|
||||
});
|
||||
|
||||
it('cannot remove without token', async function () {
|
||||
|
||||
Reference in New Issue
Block a user