-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
handler: Use generate secrets function as used in cmd (ory#1674)
If a client is being created by the api and the client_secret is not specified then the client_secret is being generated as a random string of length 26.
- Loading branch information
1 parent
bca3e0f
commit bf2f0fe
Showing
2 changed files
with
20 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { prng } from '../../helpers'; | ||
|
||
describe('The Clients Admin Interface', function() { | ||
const nc = () => ({ | ||
client_id: prng(), | ||
scope: 'foo openid offline_access', | ||
grant_types: ['client_credentials'] | ||
}); | ||
|
||
it('should return client_secret with length 26 for newly created clients without client_secret specified', function() { | ||
const client = nc(); | ||
|
||
cy.request('POST', Cypress.env('admin_url') + '/clients', JSON.stringify(client)) | ||
.then((response) => { | ||
expect(response.body.client_secret.length).to.equal(26) | ||
}) | ||
}); | ||
}); |