-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Defer initializing default Google oAuth until needed * Support multiple oAuth configurations as an array in oauth-config.json. e.g. an Azure and Amazon config
- Loading branch information
Showing
13 changed files
with
199 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
{ | ||
"client_id": "3f4ujenfmr77tg12idlkebpkoh", | ||
"client_secret": "en1q6638m4dogrr6erhrmitim67sjilc6htjnfmf6ljk2q3j9og", | ||
"apiKey": "", | ||
"project_id": "igv", | ||
"auth_provider": "Amazon", | ||
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", | ||
"aws_region": "ap-southeast-2", | ||
"scope": "email%20openid%20profile", | ||
"redirect_uris": [ | ||
"http://localhost:60151/oauthCallback" | ||
], | ||
"client_id": "3f4ujenfmr77tg12iofbebpkoh", | ||
"client_secret": "en1q6638m4dogrr6erhosetim67sjilc6htjnfmf6ljk2q3j9og", | ||
"authorization_endpoint": "https://igv-demo.auth.ap-southeast-2.amazoncognito.com/login", | ||
"token_endpoint": "https://igv-demo.auth.ap-southeast-2.amazoncognito.com/token", | ||
"aws_cognito_fed_pool_id": "ap-southeast-2:15b7bf93-18ca-40d5-99e9-38b4eb69363e", | ||
"aws_cognito_pool_id": "ap-southeast-2_IYMvlZzmv", | ||
"aws_cognito_role_arn": "arn:aws:iam::YOUR_AWS_ACCOUNT:role/YOUR_Cognito_igvAuth_Role" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
{ | ||
"client_id": "661332306814-gb4r480jnb6rres3iv8a5f48dms5ququu.apps.googleusercontent.com", | ||
"client_secret": "MFqdc7apizmtb8n08Ze810V6", | ||
"client_id": "YOUR_CLIENT_ID", | ||
"client_secret": "YOUR_CLIENT_SECRET", | ||
"auth_uri": "https://accounts.google.com/o/oauth2/auth", | ||
"token_uri": "https://accounts.google.com/o/oauth2/token", | ||
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", | ||
"redirect_uris": [ | ||
"http://localhost:60151/oauthCallback" | ||
], | ||
"hosts": ["www.googleapis.com", "storage.cloud.google.com", "storage.googleapis.com"] | ||
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
{ | ||
"client_id": "hbq82djj-qwer-7iub-j7zq-7i8nv72n48nq", | ||
"client_secret": "cVAX64fXRikCLmtAow/cktrAtaHz/tmB3WHKhnbXN2Gq", | ||
"authorization_endpoint": "https://login.microsoftonline.com/77nwe2q2-e53r-uq2p-7vdh-9z7px83zmtiv/oauth2/authorize", | ||
"token_endpoint": "https://login.microsoftonline.com/77nwe2q2-e53r-wk32-7vdh-9z7px83zmtiv/oauth2/token", | ||
"client_id": "YOUR_CLIENT_ID", | ||
"client_secret": "YOUR_CLIENT_SECRET", | ||
"authorization_endpoint": "https://login.microsoftonline.com/.../oauth2/authorize", | ||
"token_endpoint": "https://login.microsoftonline.com/.../oauth2/token", | ||
"hosts": ["prod_host.mayo.edu", "dev_host.mayo.edu", "int_host.mayo.edu"], | ||
"auth_provider": "Mayo Clinic", | ||
"app_id_uri": "https://orgtools.onmicrosoft.com/6q9qk3mr-pu78-eu73-vx5a-nqw2aqidutm9", | ||
"auth_provider": "YOUR PROVIDER", | ||
"app_id_uri": "https://orgtools.onmicrosoft.com/...", | ||
"scope": "openid" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package org.broad.igv.oauth; | ||
|
||
import javax.swing.*; | ||
import java.awt.*; | ||
import java.awt.datatransfer.Clipboard; | ||
import java.awt.datatransfer.StringSelection; | ||
import java.awt.event.ActionEvent; | ||
import java.awt.event.ActionListener; | ||
|
||
public class OAuthURLForm extends JDialog { | ||
|
||
private static JPanel getPanel(String url) { | ||
JPanel panel = new JPanel(); | ||
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); | ||
panel.setMinimumSize(new Dimension(400, 300)); | ||
panel.setPreferredSize(new Dimension(400, 300)); | ||
//this.add(panel); | ||
|
||
JPanel headerPanel = new JPanel(); | ||
headerPanel.setLayout(new FlowLayout()); | ||
JLabel label = new JLabel("Copy this authorization URL to your web browser"); | ||
headerPanel.add(label); | ||
|
||
Button copyButton = new Button("Copy"); | ||
copyButton.addActionListener(e -> { | ||
StringSelection selection = new StringSelection(url); | ||
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); | ||
clipboard.setContents(selection, selection); | ||
}); | ||
headerPanel.add(copyButton); | ||
panel.add(headerPanel); | ||
|
||
JTextArea textArea = new JTextArea(url); | ||
textArea.setMargin(new Insets(10, 10, 10, 10)); | ||
textArea.setLineWrap(true); | ||
panel.add(textArea); | ||
|
||
panel.setAlignmentX(Component.LEFT_ALIGNMENT); | ||
|
||
return panel; | ||
} | ||
|
||
public static void open(Frame owner, String url) { | ||
|
||
JPanel panel = getPanel(url); | ||
JOptionPane.showMessageDialog(owner, | ||
panel, | ||
"OAuth Authorization URL", | ||
JOptionPane.PLAIN_MESSAGE); | ||
|
||
} | ||
|
||
|
||
public static void main(String[] args) { | ||
|
||
open(null, "https://docs.oracle.com/javase/tutorial/displayCode.html?code=https://docs.oracle.com/javase/tutorial/uiswing/examples/layout/BoxLayoutDemoProject/src/layout/BoxLayoutDemo.java"); | ||
} | ||
} | ||
|
||
|
Oops, something went wrong.