Skip to content

Commit

Permalink
Change Okta's authorization server to default (#406)
Browse files Browse the repository at this point in the history
* Use default authorization server for Okta

* Add changeset

* Use patch
  • Loading branch information
vibhanshub authored Feb 14, 2024
1 parent 04dde31 commit 327d525
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/cold-waves-brush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@gitbook/integration-va-okta': patch
---

Use default authorization server
4 changes: 2 additions & 2 deletions integrations/va-okta/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ const handleFetchEvent: FetchEventCallback<OktaRuntimeContext> = async (request,
scope: 'openid',
redirect_uri: `${installationURL}/visitor-auth/response`,
});
const accessTokenURL = `https://${oktaDomain}/oauth2/default/v1/token/`;
const accessTokenURL = `https://${oktaDomain}/oauth2/v1/token/`;
const resp: any = await fetch(accessTokenURL, {
method: 'POST',
headers: { 'content-type': 'application/x-www-form-urlencoded' },
Expand Down Expand Up @@ -272,7 +272,7 @@ export default createIntegration({
const clientId = environment.spaceInstallation?.configuration.client_id;
const location = event.location ? event.location : '';

const url = new URL(`https://${oktaDomain}/oauth2/default/v1/authorize`);
const url = new URL(`https://${oktaDomain}/oauth2/v1/authorize`);
url.searchParams.append('client_id', clientId);
url.searchParams.append('response_type', 'code');
url.searchParams.append('redirect_uri', `${installationURL}/visitor-auth/response`);
Expand Down

0 comments on commit 327d525

Please sign in to comment.