add client secret option
This commit is contained in:
parent
b025bffc9d
commit
bc1ca95aea
1 changed files with 62 additions and 2 deletions
|
|
@ -67,6 +67,7 @@ interface UseConnectionOptions {
|
|||
// Custom headers support
|
||||
customHeaders?: CustomHeaders;
|
||||
oauthClientId?: string;
|
||||
oauthClientSecret?: string;
|
||||
oauthScope?: string;
|
||||
config: InspectorConfig;
|
||||
connectionType?: "direct" | "proxy";
|
||||
|
|
@ -89,6 +90,7 @@ export function useConnection({
|
|||
env,
|
||||
customHeaders,
|
||||
oauthClientId,
|
||||
oauthClientSecret,
|
||||
oauthScope,
|
||||
config,
|
||||
connectionType = "proxy",
|
||||
|
|
@ -125,12 +127,20 @@ export function useConnection({
|
|||
return;
|
||||
}
|
||||
|
||||
const clientInformation: { client_id: string; client_secret?: string } = {
|
||||
client_id: oauthClientId,
|
||||
};
|
||||
|
||||
if (oauthClientSecret) {
|
||||
clientInformation.client_secret = oauthClientSecret;
|
||||
}
|
||||
|
||||
saveClientInformationToSessionStorage({
|
||||
serverUrl: sseUrl,
|
||||
clientInformation: { client_id: oauthClientId },
|
||||
clientInformation,
|
||||
isPreregistered: true,
|
||||
});
|
||||
}, [oauthClientId, sseUrl]);
|
||||
}, [oauthClientId, oauthClientSecret, sseUrl]);
|
||||
|
||||
const pushHistory = (request: object, response?: object) => {
|
||||
setRequestHistory((prev) => [
|
||||
|
|
|
|||
Loading…
Reference in a new issue