Skip to content

Commit

Permalink
feat(breaking): default auth with client_credentials for introspect a…
Browse files Browse the repository at this point in the history
…nd revoke

This reverts commit 4b0c9a9.
  • Loading branch information
jasonraimondi committed Aug 11, 2024
1 parent 20abaf4 commit 5646d68
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export const DEFAULT_AUTHORIZATION_SERVER_OPTIONS: AuthorizationServerOptions =
tokenCID: "id",
issuer: undefined,
scopeDelimiter: " ",
introspectWithClientCredentials: false,
revokeWithClientCredentials: false,
introspectWithClientCredentials: true,
revokeWithClientCredentials: true,
};
20 changes: 7 additions & 13 deletions test/e2e/authorization_server.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,7 @@ describe("authorization_server", () => {
allowedGrants: ["client_credentials"],
scopes: [],
};
// skipping for v3.6.0 where there is no auth needed by default
// const basicAuth = "Basic " + base64encode(`${client.id}:${client.secret}`);
const basicAuth = "Basic " + base64encode(`${client.id}:${client.secret}`);

let accessToken: OAuthToken;
let request: OAuthRequest;
Expand Down Expand Up @@ -396,8 +395,7 @@ describe("authorization_server", () => {
});
});

// skipping for v3.6.0 where there is no auth by default
describe.skip("with invalid auth", () => {
describe("with invalid auth", () => {
beforeEach(() => {
request = new OAuthRequest({
headers: {},
Expand All @@ -415,8 +413,7 @@ describe("authorization_server", () => {
beforeEach(() => {
request = new OAuthRequest({
headers: {
// skipping for v3.6.0 where there is no auth needed by default
// authorization: basicAuth,
authorization: basicAuth,
},
});
});
Expand Down Expand Up @@ -535,8 +532,7 @@ describe("authorization_server", () => {
allowedGrants: ["client_credentials", "authorization_code"],
scopes: [],
};
// skipping for v3.6.0 where there is no auth needed by default
// const basicAuth = "Basic " + base64encode(`${client.id}:${client.secret}`);
const basicAuth = "Basic " + base64encode(`${client.id}:${client.secret}`);

let accessToken: OAuthToken;
let request: OAuthRequest;
Expand All @@ -554,7 +550,7 @@ describe("authorization_server", () => {

describe("without option revokeWithClientCredentials=false", () => {
it("does not require client credentials", async () => {
const authorizationServer = new AuthorizationServer(
authorizationServer = new AuthorizationServer(
inMemoryClientRepository,
inMemoryAccessTokenRepository,
inMemoryScopeRepository,
Expand Down Expand Up @@ -588,8 +584,7 @@ describe("authorization_server", () => {
});
});

// skipping for v3.6.0 where there is no auth by default
describe.skip("with invalid auth", () => {
describe("with invalid auth", () => {
beforeEach(() => {
request = new OAuthRequest({
headers: {},
Expand All @@ -607,8 +602,7 @@ describe("authorization_server", () => {
beforeEach(() => {
request = new OAuthRequest({
headers: {
// skipping for v3.6.0 where there is no auth needed by default
// authorization: basicAuth,
authorization: basicAuth,
},
});
});
Expand Down

0 comments on commit 5646d68

Please sign in to comment.