Set custom oidc client id and secret in the backend
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user