@Override public void verifyExternal(final String authzid, final String subjectDn, final Handler<AsyncResult<HonoUser>> authenticationResultHandler) { client.verifyExternal(authzid, subjectDn, authenticationResultHandler); }
@Override public void verifyPlain(final String authzid, final String authcid, final String password, final Handler<AsyncResult<HonoUser>> authenticationResultHandler) { client.verifyPlain(authzid, authcid, password, authenticationResultHandler); }
@Override protected void doStart(final Future<Void> startFuture) { if (factory == null) { startFuture.fail("no connection factory for Authentication service set"); } else { client = new AuthenticationServerClient(vertx, factory); startFuture.complete(); } }
private void getToken(final ProtonConnection openCon, final Future<HonoUser> authResult) { final ProtonMessageHandler messageHandler = (delivery, message) -> { final String type = MessageHelper.getApplicationProperty( message.getApplicationProperties(), AuthenticationConstants.APPLICATION_PROPERTY_TYPE, String.class); if (AuthenticationConstants.TYPE_AMQP_JWT.equals(type)) { final String payload = MessageHelper.getPayloadAsString(message); if (payload != null) { final HonoUser user = new HonoUserAdapter() { @Override public String getToken() { return payload; } }; LOG.debug("successfully retrieved token from Authentication service"); authResult.complete(user); } else { authResult.fail("message from Authentication service contains no body"); } } else { authResult.fail("Authentication service issued unsupported token [type: " + type + "]"); } }; openReceiver(openCon, messageHandler).compose(openReceiver -> { LOG.debug("opened receiver link to Authentication service, waiting for token ..."); }, authResult); }
getToken(openCon, userTracker);
@Override protected void doStart(final Future<Void> startFuture) { if (factory == null) { startFuture.fail("no connection factory for Authentication service set"); } else { client = new AuthenticationServerClient(vertx, factory); startFuture.complete(); } }
@Override public void verifyPlain(final String authzid, final String authcid, final String password, final Handler<AsyncResult<HonoUser>> authenticationResultHandler) { client.verifyPlain(authzid, authcid, password, authenticationResultHandler); }
@Override public void verifyExternal(final String authzid, final String subjectDn, final Handler<AsyncResult<HonoUser>> authenticationResultHandler) { client.verifyExternal(authzid, subjectDn, authenticationResultHandler); }