Skip to content

Commit

Permalink
cleanup and additional logging for login flow
Browse files Browse the repository at this point in the history
  • Loading branch information
AO-StreetArt committed Dec 13, 2018
1 parent dabcfec commit 05cb2c4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/main/java/com/ao/adrestia/filters/RoutingFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -226,15 +226,19 @@ public Object run() {
if (httpAuthActive) {
String credentialsString = "";
if (isAvcRequest) {
log.debug("Setting AVC Credentials with User {}", avcUsername);
credentialsString =
Base64.getEncoder().encodeToString((avcUsername + ":" + avcPassword).getBytes(StandardCharsets.ISO_8859_1));
} else if (isClymanRequest) {
log.debug("Setting CLyman Credentials with User {}", clymanUsername);
credentialsString =
Base64.getEncoder().encodeToString((clymanUsername + ":" + clymanPassword).getBytes(StandardCharsets.ISO_8859_1));
} else if (isIvanRequest) {
log.debug("Setting Ivan Credentials with User {}", ivanUsername);
credentialsString =
Base64.getEncoder().encodeToString((ivanUsername + ":" + ivanPassword).getBytes(StandardCharsets.ISO_8859_1));
} else if (isProjectRequest) {
log.debug("Setting Projects Credentials with User {}", projectsUsername);
credentialsString =
Base64.getEncoder().encodeToString((projectsUsername + ":" + projectsPassword).getBytes(StandardCharsets.ISO_8859_1));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected void doFilterInternal(HttpServletRequest req,

private UsernamePasswordAuthenticationToken getAuthentication(HttpServletRequest request) {
String token = request.getHeader(HEADER_STRING);
if (token != null) {
if (token != null && token.contains(TOKEN_PREFIX)) {
log.debug("Parsing JWT from Authorization Header");
token = token.replace(TOKEN_PREFIX, "");
} else {
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ spring.cloud.consul.discovery.port=8500

# Zuul Endpoints to monitor
zuul.routes.v1.url=http://localhost:8090
# This should allow Zuul to route https requests, for some reason
eureka.instance.secureVirtualHostName=${spring.application.name}
# Logging
logging.level.org.springframework=INFO
logging.level.org.apache.http=INFO
Expand Down

0 comments on commit 05cb2c4

Please sign in to comment.