Skip to content

Commit

Permalink
Merge pull request #1 from moritzgloeckl/various-bugfixes
Browse files Browse the repository at this point in the history
Some code improvements
  • Loading branch information
sebastianhaas committed Aug 27, 2019
2 parents c536994 + 89980d7 commit b413b89
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Expand Up @@ -10,7 +10,7 @@
public class SampleSecurityConfiguration {

@Bean
public SecurityWebFilterChain configure(ServerHttpSecurity http) throws Exception {
public SecurityWebFilterChain configure(ServerHttpSecurity http) {
return http
.csrf().disable()
.authorizeExchange()
Expand Down
@@ -1,6 +1,5 @@
package io.tapkey.developers.auth;

import io.tapkey.developers.auth.SampleUserPrincipal;
import io.tapkey.developers.data.User;
import io.tapkey.developers.data.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down
Expand Up @@ -49,7 +49,7 @@ public User(String username, String password, String firstName, String lastName,
@Override
public String toString() {
return String.format(
"Customer[id=%d, firstName='%s', lastName='%s']",
"Customer[id=%s, firstName='%s', lastName='%s']",
getId(), getFirstName(), getLastName());
}

Expand Down
Expand Up @@ -69,11 +69,12 @@ public class SampleTapkeyTokenExchangeService implements TapkeyTokenExchangeServ
public String createJwtToken(String userId) {
Calendar expiration = Calendar.getInstance();
expiration.roll(Calendar.HOUR, 1);

HashMap<String, Object> claims = new HashMap<>();
claims.put("http://tapkey.net/oauth/token_exchange/client_id", oauthClientId);

return Jwts.builder()
.addClaims(new HashMap<String, Object>() {{
put("http://tapkey.net/oauth/token_exchange/client_id", oauthClientId);
}})
.addClaims(claims)
.setSubject(userId)
.setAudience(identityProviderAudience)
.setIssuer(identityProviderIssuer)
Expand Down

0 comments on commit b413b89

Please sign in to comment.