congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
AuthenticationServerClient.openReceiver
Code IndexAdd Tabnine to your IDE (free)

How to use
openReceiver
method
in
org.eclipse.hono.client.AuthenticationServerClient

Best Java code snippets using org.eclipse.hono.client.AuthenticationServerClient.openReceiver (Showing top 1 results out of 315)

origin: org.eclipse.hono/hono-client

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);
}
org.eclipse.hono.clientAuthenticationServerClientopenReceiver

Popular methods of AuthenticationServerClient

  • <init>
    Creates a client for a remote authentication server.
  • getToken
  • verifyExternal
    Verifies a Subject DN with a remote authentication server using SASL EXTERNAL. This method currentl
  • verifyPlain
    Verifies username/password credentials with a remote authentication server using SASL PLAIN.

Popular in Java

  • Creating JSON documents from java classes using gson
  • runOnUiThread (Activity)
  • onCreateOptionsMenu (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now