use of com.symphony.api.model.Token in project spring-bot by finos.
the class RSAAuthIT method testKeyManagerAuthWithRSA.
@ParameterizedTest
@MethodSource("setupConfigurations")
public void testKeyManagerAuthWithRSA(TestClientStrategy s) throws Exception {
SymphonyIdentity id = s.getIdentity();
String jwt = JWTHelper.createSignedJwt(id.getCommonName(), id.getPrivateKey());
AuthenticationApi keyApi = s.getRSAKeyAuthApi();
AuthenticateRequest req = new AuthenticateRequest();
req.setToken(jwt);
Token done = keyApi.pubkeyAuthenticatePost(req);
System.out.println(done);
}
use of com.symphony.api.model.Token in project spring-bot by finos.
the class RSAAuthIT method testSessionAuthWithRSA.
@ParameterizedTest
@MethodSource("setupConfigurations")
public void testSessionAuthWithRSA(TestClientStrategy s) throws Exception {
SymphonyIdentity id = s.getIdentity();
String jwt = JWTHelper.createSignedJwt(id.getCommonName(), id.getPrivateKey());
System.out.println(jwt);
System.out.println(JWTHelper.decodeJwt(jwt));
AuthenticationApi sessionApi = s.getRSASessionAuthApi();
AuthenticateRequest req = new AuthenticateRequest();
req.setToken(jwt);
Token done = sessionApi.pubkeyAuthenticatePost(req);
System.out.println(done);
}
use of com.symphony.api.model.Token in project spring-bot by finos.
the class SymphonyMessageSender method jwtAuth.
private Token jwtAuth(ApiBuilder apiBuilder) {
try {
String token = JWTHelper.createSignedJwt(id.getCommonName(), id.getPrivateKey());
AuthenticateRequest ar = new AuthenticateRequest().token(token);
Token out = apiBuilder.getApi(com.symphony.api.login.AuthenticationApi.class).pubkeyAuthenticatePost(ar);
return out;
} catch (Exception e) {
throw new RuntimeException("Couldn't auth with jwt", e);
}
}
Aggregations