/*
 * Copyright 2014 Red Hat, Inc.
 *
 * Red Hat licenses this file to you under the Apache License, version 2.0
 * (the "License"); you may not use this file except in compliance with the
 * License.  You may obtain a copy of the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */

package io.vertx.reactivex.ext.auth.oauth2;

import io.vertx.reactivex.RxHelper;
import io.vertx.reactivex.ObservableHelper;
import io.vertx.reactivex.FlowableHelper;
import io.vertx.reactivex.impl.AsyncResultMaybe;
import io.vertx.reactivex.impl.AsyncResultSingle;
import io.vertx.reactivex.impl.AsyncResultCompletable;
import io.vertx.reactivex.WriteStreamObserver;
import io.vertx.reactivex.WriteStreamSubscriber;
import java.util.Map;
import java.util.Set;
import java.util.List;
import java.util.Iterator;
import java.util.function.Function;
import java.util.stream.Collectors;
import io.vertx.core.Handler;
import io.vertx.core.AsyncResult;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
import io.vertx.lang.rx.RxGen;
import io.vertx.lang.rx.TypeArg;
import io.vertx.lang.rx.MappingIterator;

Helper class for processing Keycloak principal.

NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.
/** * Helper class for processing Keycloak principal. * * <p/> * NOTE: This class has been automatically generated from the {@link io.vertx.ext.auth.oauth2.KeycloakHelper original} non RX-ified interface using Vert.x codegen. */
@RxGen(io.vertx.ext.auth.oauth2.KeycloakHelper.class) public class KeycloakHelper { @Override public String toString() { return delegate.toString(); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; KeycloakHelper that = (KeycloakHelper) o; return delegate.equals(that.delegate); } @Override public int hashCode() { return delegate.hashCode(); } public static final TypeArg<KeycloakHelper> __TYPE_ARG = new TypeArg<>( obj -> new KeycloakHelper((io.vertx.ext.auth.oauth2.KeycloakHelper) obj), KeycloakHelper::getDelegate ); private final io.vertx.ext.auth.oauth2.KeycloakHelper delegate; public KeycloakHelper(io.vertx.ext.auth.oauth2.KeycloakHelper delegate) { this.delegate = delegate; } public KeycloakHelper(Object delegate) { this.delegate = (io.vertx.ext.auth.oauth2.KeycloakHelper)delegate; } public io.vertx.ext.auth.oauth2.KeycloakHelper getDelegate() { return delegate; }
Get raw `id_token` string from the principal.
Params:
  • principal – user principal
Returns:the raw id token string
/** * Get raw `id_token` string from the principal. * @param principal user principal * @return the raw id token string */
@Deprecated() public static String rawIdToken(JsonObject principal) { String ret = io.vertx.ext.auth.oauth2.KeycloakHelper.rawIdToken(principal); return ret; }
Get decoded `id_token` from the principal.
Params:
  • principal – user principal
Returns:the id token
/** * Get decoded `id_token` from the principal. * @param principal user principal * @return the id token */
@Deprecated() public static JsonObject idToken(JsonObject principal) { JsonObject ret = io.vertx.ext.auth.oauth2.KeycloakHelper.idToken(principal); return ret; }
Get raw `access_token` string from the principal.
Params:
  • principal – user principal
Returns:the raw access token string
/** * Get raw `access_token` string from the principal. * @param principal user principal * @return the raw access token string */
@Deprecated() public static String rawAccessToken(JsonObject principal) { String ret = io.vertx.ext.auth.oauth2.KeycloakHelper.rawAccessToken(principal); return ret; }
Get decoded `access_token` from the principal.
Params:
  • principal – user principal
Returns:the access token
/** * Get decoded `access_token` from the principal. * @param principal user principal * @return the access token */
@Deprecated() public static JsonObject accessToken(JsonObject principal) { JsonObject ret = io.vertx.ext.auth.oauth2.KeycloakHelper.accessToken(principal); return ret; } @Deprecated() public static int authTime(JsonObject principal) { int ret = io.vertx.ext.auth.oauth2.KeycloakHelper.authTime(principal); return ret; } @Deprecated() public static String sessionState(JsonObject principal) { String ret = io.vertx.ext.auth.oauth2.KeycloakHelper.sessionState(principal); return ret; } @Deprecated() public static String acr(JsonObject principal) { String ret = io.vertx.ext.auth.oauth2.KeycloakHelper.acr(principal); return ret; } @Deprecated() public static String name(JsonObject principal) { String ret = io.vertx.ext.auth.oauth2.KeycloakHelper.name(principal); return ret; } @Deprecated() public static String email(JsonObject principal) { String ret = io.vertx.ext.auth.oauth2.KeycloakHelper.email(principal); return ret; } @Deprecated() public static String preferredUsername(JsonObject principal) { String ret = io.vertx.ext.auth.oauth2.KeycloakHelper.preferredUsername(principal); return ret; } @Deprecated() public static String nickName(JsonObject principal) { String ret = io.vertx.ext.auth.oauth2.KeycloakHelper.nickName(principal); return ret; } @Deprecated() public static Set<String> allowedOrigins(JsonObject principal) { Set<String> ret = io.vertx.ext.auth.oauth2.KeycloakHelper.allowedOrigins(principal); return ret; }
Parse the token string with base64 decoder. This will only obtain the "payload" part of the token.
Params:
  • token – token string
Returns:token payload json object
/** * Parse the token string with base64 decoder. * This will only obtain the "payload" part of the token. * @param token token string * @return token payload json object */
@Deprecated() public static JsonObject parseToken(String token) { JsonObject ret = io.vertx.ext.auth.oauth2.KeycloakHelper.parseToken(token); return ret; } public static KeycloakHelper newInstance(io.vertx.ext.auth.oauth2.KeycloakHelper arg) { return arg != null ? new KeycloakHelper(arg) : null; } }