Skip to content

Commit

Permalink
Merge branch 'main' into sync-git-repository
Browse files Browse the repository at this point in the history
  • Loading branch information
taranvohra authored Feb 23, 2024
2 parents b1091eb + 572b637 commit 98b9fb2
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 22 deletions.
13 changes: 13 additions & 0 deletions integrations/va-auth0/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# @gitbook/integration-va-auth0

## 0.0.3

### Patch Changes

- d06c529: Move Redirect URI instructions above the save button

## 0.0.2

### Patch Changes

- 4674af3: Improve logging for VA integrations
2 changes: 1 addition & 1 deletion integrations/va-auth0/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gitbook/integration-va-auth0",
"version": "0.0.1",
"version": "0.0.3",
"private": true,
"dependencies": {
"@gitbook/api": "*",
Expand Down
18 changes: 12 additions & 6 deletions integrations/va-auth0/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,13 @@ const configBlock = createComponent<Auth0Props, Auth0State, Auth0Action, Auth0Ru
}
element={<textinput state="client_secret" placeholder="Client Secret" />}
/>

<divider size="medium" />
<hint>
<text style="bold">
The following URL needs to be saved as an allowed callback URL in Auth0:
</text>
</hint>
<codeblock content={VACallbackURL} />
<input
label=""
hint=""
Expand All @@ -144,11 +150,6 @@ const configBlock = createComponent<Auth0Props, Auth0State, Auth0Action, Auth0Ru
/>
}
/>
<divider size="medium" />
<text>
The following URL needs to be saved as an allowed callback URL in Auth0:
</text>
<codeblock content={VACallbackURL} />
</block>
);
},
Expand Down Expand Up @@ -225,6 +226,11 @@ const handleFetchEvent: FetchEventCallback<Auth0RuntimeContext> = async (request
);
}
} else {
logger.debug(
`Did not receive access token. Error: ${(resp && resp.error) || ''} ${
(resp && resp.error_description) || ''
}`
);
return new Response('Error: No Access Token found in response from Auth0', {
status: 401,
});
Expand Down
13 changes: 13 additions & 0 deletions integrations/va-azure/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# @gitbook/integration-va-azure

## 0.0.3

### Patch Changes

- d06c529: Move Redirect URI instructions above the save button

## 0.0.2

### Patch Changes

- 4674af3: Improve logging for VA integrations
2 changes: 1 addition & 1 deletion integrations/va-azure/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gitbook/integration-va-azure",
"version": "0.0.1",
"version": "0.0.3",
"private": true,
"dependencies": {
"@gitbook/api": "*",
Expand Down
19 changes: 12 additions & 7 deletions integrations/va-azure/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,13 @@ const configBlock = createComponent<AzureProps, AzureState, AzureAction, AzureRu
}
element={<textinput state="client_secret" placeholder="Client Secret" />}
/>

<divider size="medium" />
<hint>
<text style="bold">
The following URL needs to be saved as an allowed Redirect URI in Azure:
</text>
</hint>
<codeblock content={VACallbackURL} />
<input
label=""
hint=""
Expand All @@ -145,12 +151,6 @@ const configBlock = createComponent<AzureProps, AzureState, AzureAction, AzureRu
/>
}
/>

<divider size="medium" />
<text>
The following URL needs to be saved as an allowed Redirect URI in Azure:
</text>
<codeblock content={VACallbackURL} />
</block>
);
},
Expand Down Expand Up @@ -228,6 +228,11 @@ const handleFetchEvent: FetchEventCallback<AzureRuntimeContext> = async (request
);
}
} else {
logger.debug(
`Did not receive access token. Error: ${(resp && resp.error) || ''} ${
(resp && resp.error_description) || ''
}`
);
return new Response('Error: No Access Token found in response from Azure', {
status: 401,
});
Expand Down
19 changes: 19 additions & 0 deletions integrations/va-okta/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# @gitbook/integration-va-okta

## 0.0.4

### Patch Changes

- d06c529: Move Redirect URI instructions above the save button

## 0.0.3

### Patch Changes

- 327d525: Use default authorization server

## 0.0.2

### Patch Changes

- 4674af3: Improve logging for VA integrations
2 changes: 1 addition & 1 deletion integrations/va-okta/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gitbook/integration-va-okta",
"version": "0.0.1",
"version": "0.0.4",
"private": true,
"dependencies": {
"@gitbook/api": "*",
Expand Down
20 changes: 14 additions & 6 deletions integrations/va-okta/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,13 @@ const configBlock = createComponent<OktaProps, OktaState, OktaAction, OktaRuntim
}
element={<textinput state="client_secret" placeholder="Client Secret" />}
/>

<divider size="medium" />
<hint>
<text style="bold">
The following URL needs to be saved as a Sign-In Redirect URI in Okta:
</text>
</hint>
<codeblock content={VACallbackURL} />
<input
label=""
hint=""
Expand All @@ -143,9 +149,6 @@ const configBlock = createComponent<OktaProps, OktaState, OktaAction, OktaRuntim
/>
}
/>
<divider size="medium" />
<text>The following URL needs to be saved as a Sign-In Redirect URI in Okta:</text>
<codeblock content={VACallbackURL} />
</block>
);
},
Expand Down Expand Up @@ -191,7 +194,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 @@ -225,6 +228,11 @@ const handleFetchEvent: FetchEventCallback<OktaRuntimeContext> = async (request,
);
}
} else {
logger.debug(
`Did not receive access token. Error: ${(resp && resp.error) || ''} ${
(resp && resp.error_description) || ''
}`
);
return new Response('Error: No Access Token found in response from Okta', {
status: 401,
});
Expand Down Expand Up @@ -267,7 +275,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 98b9fb2

Please sign in to comment.