Skip to content

Commit

Permalink
Allow client secret when usePkceWithAuthorizationCodeGrant is true, r…
Browse files Browse the repository at this point in the history
  • Loading branch information
RicoSuter authored and lahma committed Jun 13, 2024
1 parent 6e499b5 commit f6e43e9
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 f6e43e9

Please sign in to comment.