code: public CompletionStage<Result> currentUser() {
          return SecureSocial.currentUser(env).thenApply( new Function<Object, Result>() {
              public Result apply(Object maybeUser) {
                  String id;
  
                  if ( maybeUser != null ) {
                      DemoUser user = (DemoUser) maybeUser;
                      id = user.main.userId();
                  } else {
                      id = "not available. Please log in.";
                  }
                  return ok("your id is " + id);
              }
          });
      }
docs: Sample use of SecureSocial.currentUser. Access the /current-user to test it