private String getUserName() { AccessToken tok = (AccessToken) user.getDelegate(); return tok.accessToken().getString("preferred_username"); }
if (authenticatedUser == null || !(authenticatedUser.getDelegate() instanceof io.gravitee.am.gateway.handler.vertx.auth.user.User)) { io.gravitee.am.model.User endUser = ((io.gravitee.am.gateway.handler.vertx.auth.user.User) authenticatedUser.getDelegate()).getUser(); Date loggedAt = endUser.getLoggedAt(); if (loggedAt == null) {
if (authenticatedUser == null || !(authenticatedUser.getDelegate() instanceof io.gravitee.am.gateway.handler.vertx.auth.user.User)) { io.gravitee.am.model.User endUser = ((io.gravitee.am.gateway.handler.vertx.auth.user.User) authenticatedUser.getDelegate()).getUser(); Date loggedAt = endUser.getLoggedAt(); if (loggedAt == null) {
@Override public void handle(RoutingContext context) { // The authorization server first validates the client credentials (in // case of a confidential client) and then verifies whether the token // was issued to the client making the revocation request. If this // validation fails, the request is refused and the client is informed // of the error by the authorization server as described below. User authenticatedUser = context.user(); if (authenticatedUser == null || ! (authenticatedUser.getDelegate() instanceof Client)) { throw new InvalidClientException("Invalid client"); } Client client = (Client) authenticatedUser.getDelegate(); revocationTokenService .revoke(createRequest(context), client.getClient()) .subscribe(() -> context.response().setStatusCode(200).end(), error -> context.fail(error)); }
@Override public void handle(RoutingContext context) { // The authorization server first validates the client credentials (in // case of a confidential client) and then verifies whether the token // was issued to the client making the revocation request. If this // validation fails, the request is refused and the client is informed // of the error by the authorization server as described below. User authenticatedUser = context.user(); if (authenticatedUser == null || ! (authenticatedUser.getDelegate() instanceof Client)) { throw new InvalidClientException("Invalid client"); } Client client = (Client) authenticatedUser.getDelegate(); revocationTokenService .revoke(createRequest(context), client.getClient()) .subscribe(() -> context.response().setStatusCode(200).end(), error -> context.fail(error)); }
if (authenticatedUser == null || ! (authenticatedUser.getDelegate() instanceof io.gravitee.am.gateway.handler.vertx.auth.user.User)) { throw new AccessDeniedException(); io.gravitee.am.model.User endUser = ((io.gravitee.am.gateway.handler.vertx.auth.user.User) authenticatedUser.getDelegate()).getUser();
if (authenticatedUser == null || ! (authenticatedUser.getDelegate() instanceof io.gravitee.am.gateway.handler.vertx.auth.user.User)) { throw new AccessDeniedException(); io.gravitee.am.model.User endUser = ((io.gravitee.am.gateway.handler.vertx.auth.user.User) authenticatedUser.getDelegate()).getUser();
if (authenticatedUser == null || ! (authenticatedUser.getDelegate() instanceof io.gravitee.am.gateway.handler.vertx.auth.user.User)) { throw new AccessDeniedException(); io.gravitee.am.model.User endUser = ((io.gravitee.am.gateway.handler.vertx.auth.user.User) authenticatedUser.getDelegate()).getUser();
@Override public void handle(RoutingContext context) { // If the protected resource uses OAuth 2.0 client credentials to // authenticate to the introspection endpoint and its credentials are // invalid, the authorization server responds with an HTTP 401 User authenticatedUser = context.user(); if (authenticatedUser == null || ! (authenticatedUser.getDelegate() instanceof Client)) { throw new InvalidClientException(); } introspectionService .introspect(createRequest(context)) .doOnSuccess(introspectionResponse -> context.response() .putHeader(HttpHeaders.CACHE_CONTROL, "no-store") .putHeader(HttpHeaders.PRAGMA, "no-cache") .putHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) .end(Json.encodePrettily(introspectionResponse))) .subscribe(); }
if (authenticatedUser == null || ! (authenticatedUser.getDelegate() instanceof Client)) { throw new InvalidClientException(); final io.gravitee.am.model.Client client = ((Client) authenticatedUser.getDelegate()).getClient();
@Override public void handle(RoutingContext context) { // If the protected resource uses OAuth 2.0 client credentials to // authenticate to the introspection endpoint and its credentials are // invalid, the authorization server responds with an HTTP 401 User authenticatedUser = context.user(); if (authenticatedUser == null || ! (authenticatedUser.getDelegate() instanceof Client)) { throw new InvalidClientException(); } introspectionService .introspect(createRequest(context)) .doOnSuccess(introspectionResponse -> context.response() .putHeader(HttpHeaders.CACHE_CONTROL, "no-store") .putHeader(HttpHeaders.PRAGMA, "no-cache") .putHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) .end(Json.encodePrettily(introspectionResponse))) .subscribe(); }
if (authenticatedUser == null || ! (authenticatedUser.getDelegate() instanceof io.gravitee.am.gateway.handler.vertx.auth.user.User)) { throw new AccessDeniedException(); io.gravitee.am.model.User endUser = ((io.gravitee.am.gateway.handler.vertx.auth.user.User) authenticatedUser.getDelegate()).getUser();
if (authenticatedUser == null || ! (authenticatedUser.getDelegate() instanceof Client)) { throw new InvalidClientException(); final io.gravitee.am.model.Client client = ((Client) authenticatedUser.getDelegate()).getClient();
if (authenticatedUser == null || ! (authenticatedUser.getDelegate() instanceof Client)) { throw new InvalidClientException();
if (authenticatedUser == null || ! (authenticatedUser.getDelegate() instanceof Client)) { throw new InvalidClientException();
auth != null ? io.vertx.rxjava.ext.auth.AuthProvider.newInstance(auth.getDelegate()) : null); ResteasyProviderFactory.pushContext(io.vertx.rxjava.ext.auth.User.class, context.user() != null ? io.vertx.rxjava.ext.auth.User.newInstance(context.user().getDelegate()) : null);
auth != null ? io.vertx.rxjava.ext.auth.AuthProvider.newInstance(auth.getDelegate()) : null); ResteasyProviderFactory.pushContext(io.vertx.rxjava.ext.auth.User.class, context.user() != null ? io.vertx.rxjava.ext.auth.User.newInstance(context.user().getDelegate()) : null); ResteasyProviderFactory.pushContext(io.vertx.rxjava.ext.web.Session.class, context.session() != null ? io.vertx.rxjava.ext.web.Session.newInstance(context.session().getDelegate()) : null);