Skip to content

Commit

Permalink
Allow client secret when usePkceWithAuthorizationCodeGrant is true, r…
Browse files Browse the repository at this point in the history
…evert #4184
  • Loading branch information
RicoSuter committed Jan 17, 2024
1 parent 313ea53 commit f18db2a
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/NSwag.AspNetCore/SwaggerUi/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,17 @@
});

if ("{ClientId}") {
const oAuthConfig = {
var clientSecret = "{ClientSecret}";
ui.initOAuth({
clientId: "{ClientId}",
clientSecret: clientSecret ? clientSecret : undefined,
realm: "{Realm}",
appName: "{AppName}",
scopeSeparator: "{ScopeSeparator}",
scopes: {Scopes},
additionalQueryStringParams: {AdditionalQueryStringParameters},
usePkceWithAuthorizationCodeGrant: {UsePkceWithAuthorizationCodeGrant}
};

if (!{UsePkceWithAuthorizationCodeGrant}) {
oAuthConfig.clientSecret = "{ClientSecret}";
}

ui.initOAuth(oAuthConfig);
});
}

window.ui = ui;
Expand Down

0 comments on commit f18db2a

Please sign in to comment.