Added Jira and small fixes for auto-oauth2
This commit is contained in:
@@ -72,6 +72,9 @@ const registeredApps = [
|
|||||||
"google_sheets",
|
"google_sheets",
|
||||||
"google_drive",
|
"google_drive",
|
||||||
"google_disk",
|
"google_disk",
|
||||||
|
"jira",
|
||||||
|
"jira_service_desk",
|
||||||
|
"jira_service_management",
|
||||||
]
|
]
|
||||||
|
|
||||||
const AuthenticationOauth2 = (props) => {
|
const AuthenticationOauth2 = (props) => {
|
||||||
@@ -231,21 +234,31 @@ const AuthenticationOauth2 = (props) => {
|
|||||||
["https://www.googleapis.com/auth/spreadsheets"],
|
["https://www.googleapis.com/auth/spreadsheets"],
|
||||||
admin_consent,
|
admin_consent,
|
||||||
)
|
)
|
||||||
} else if (selectedApp.name.toLowerCase().includes("google_drive")) {
|
} else if (selectedApp.name.toLowerCase().includes("google_drive") || selectedApp.name.toLowerCase().includes("google_disk")) {
|
||||||
handleOauth2Request(
|
handleOauth2Request(
|
||||||
"253565968129-6pij4g6ojim4gpum0h9m9u3bc357qsq7.apps.googleusercontent.com",
|
"253565968129-6pij4g6ojim4gpum0h9m9u3bc357qsq7.apps.googleusercontent.com",
|
||||||
"",
|
"",
|
||||||
"https://www.googleapis.com/drive/v3",
|
"https://www.googleapis.com/drive/v3",
|
||||||
["https://www.googleapis.com/auth/drive"],
|
["https://www.googleapis.com/auth/drive"],
|
||||||
|
admin_consent,
|
||||||
|
)
|
||||||
|
} else if (selectedApp.name.toLowerCase().includes("jira_service_desk") || selectedApp.name.toLowerCase().includes("jira") || selectedApp.name.toLowerCase().includes("jira_service_management")) {
|
||||||
|
handleOauth2Request(
|
||||||
|
"AI02egeCQh1Zskm1QAJaaR6dzjR97V2F",
|
||||||
|
"",
|
||||||
|
"https://api.atlassian.com",
|
||||||
|
["read:jira-work", "write:jira-work", "read:servicedesk:jira-service-management", "write:servicedesk:jira-service-management", "read:request:jira-service-management", "write:request:jira-service-management"],
|
||||||
|
|
||||||
admin_consent,
|
admin_consent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
// write:request:jira-service-management
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const handleOauth2Request = (client_id, client_secret, oauth_url, scopes, admin_consent) => {
|
const handleOauth2Request = (client_id, client_secret, oauth_url, scopes, admin_consent) => {
|
||||||
setButtonClicked(true);
|
setButtonClicked(true);
|
||||||
console.log("SCOPES: ", scopes);
|
//console.log("SCOPES: ", scopes);
|
||||||
|
|
||||||
client_id = client_id.trim()
|
client_id = client_id.trim()
|
||||||
client_secret = client_secret.trim()
|
client_secret = client_secret.trim()
|
||||||
@@ -465,7 +478,7 @@ const AuthenticationOauth2 = (props) => {
|
|||||||
authenticationOption.label = selectedApp.name + " authentication";
|
authenticationOption.label = selectedApp.name + " authentication";
|
||||||
}
|
}
|
||||||
|
|
||||||
//console.log(
|
console.log("Window: ", window.location)
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<DialogTitle>
|
<DialogTitle>
|
||||||
@@ -475,11 +488,11 @@ const AuthenticationOauth2 = (props) => {
|
|||||||
</DialogTitle>
|
</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<span style={{}}>
|
<span style={{}}>
|
||||||
Oauth2 requires a client ID and secret to authenticate, defined in the remote system. Your redirect URL is <b>https://shuffler.io/set_authentication</b>.
|
Oauth2 requires a client ID and secret to authenticate, defined in the remote system. Your redirect URL is <b>{window.location.origin}/set_authentication</b> -
|
||||||
<a
|
<a
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="norefferer"
|
rel="norefferer"
|
||||||
href="https://shuffler.io/docs/apps#authentication"
|
href="/docs/apps#authentication"
|
||||||
style={{ textDecoration: "none", color: "#f85a3e" }}
|
style={{ textDecoration: "none", color: "#f85a3e" }}
|
||||||
>
|
>
|
||||||
{" "}
|
{" "}
|
||||||
|
|||||||
Reference in New Issue
Block a user