forked from travelaudience/nexus-proxy
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More generic Authorization Code flow
Remove the hard dependency to the google cloud IAM and use the generic OAuth2 Authorization Code Flow. Configuration now happens completely through ENV variables. Also removed the check if the user is still in the organization, because it's not part of the oauth2 standard. although it is a valid check and should be considered in the future.
- Loading branch information
1 parent
0218c58
commit c59caba
Showing
11 changed files
with
117 additions
and
282 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
.secrets/ | ||
.vertx/ | ||
build/ | ||
.env |
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
21 changes: 21 additions & 0 deletions
21
src/main/java/com/travelaudience/nexus/proxy/AccessToken.java
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,21 @@ | ||
package com.travelaudience.nexus.proxy; | ||
|
||
import com.google.api.client.json.jackson2.*; | ||
import com.google.api.client.json.webtoken.*; | ||
import java.io.*; | ||
|
||
public class AccessToken { | ||
private final String rawToken; | ||
|
||
public AccessToken(String token) { | ||
rawToken = token; | ||
} | ||
|
||
public String principal() throws IOException { | ||
JsonWebSignature jws = JsonWebSignature | ||
.parser(JacksonFactory.getDefaultInstance()) | ||
.setPayloadClass(PayloadWithEmail.class) | ||
.parse(rawToken); | ||
return ((PayloadWithEmail) jws.getPayload()).getEmail(); | ||
} | ||
} |
211 changes: 0 additions & 211 deletions
211
src/main/java/com/travelaudience/nexus/proxy/CachingGoogleAuthCodeFlow.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.