Set custom oidc client id and secret in the backend

This commit is contained in:
Johannes Zellner
2023-10-06 14:11:54 +02:00
parent 41319bc817
commit 5e7bc78d35
6 changed files with 91 additions and 70 deletions
+6 -11
View File
@@ -46,15 +46,8 @@ describe('OpenID connect clients API', function () {
.send(CLIENT_0);
expect(response.statusCode).to.equal(201);
});
it('create fails for already exists', async function () {
const response = await superagent.post(`${serverUrl}/api/v1/oidc/clients`)
.query({ access_token: owner.token })
.send(CLIENT_0)
.ok(() => true);
expect(response.statusCode).to.equal(409);
CLIENT_0.id = response.body.id;
CLIENT_0.secret = response.body.secret;
});
it('can create another client', async function () {
@@ -63,6 +56,8 @@ describe('OpenID connect clients API', function () {
.send(CLIENT_1);
expect(response.statusCode).to.equal(201);
CLIENT_1.id = response.body.id;
CLIENT_1.secret = response.body.secret;
});
it('cannot get non-existing client', async function () {
@@ -127,7 +122,7 @@ describe('OpenID connect clients API', function () {
expect(response.body.clients[1].id).to.eql(CLIENT_1.id);
});
it('cannot update client without secret', async function () {
it('cann update client', async function () {
const response = await superagent.post(`${serverUrl}/api/v1/oidc/clients/${CLIENT_0.id}`)
.query({ access_token: owner.token })
.send({ loginRedirectUri: CLIENT_0.loginRedirectUri })
@@ -139,7 +134,7 @@ describe('OpenID connect clients API', function () {
it('cannot update client without loginRedirectUri', async function () {
const response = await superagent.post(`${serverUrl}/api/v1/oidc/clients/${CLIENT_0.id}`)
.query({ access_token: owner.token })
.send({ secret: CLIENT_0.secret })
.send({})
.ok(() => true);
expect(response.statusCode).to.equal(400);