@Test public void grant_user_RptWithoutPermissionCase() { parameters.add(RPT, RPT_OLD_TOKEN); when(rpt.get("permissions")).thenReturn(null); TestObserver<Token> testObserver = umaTokenGranter.grant(tokenRequest, client).test(); testObserver.assertComplete().assertNoErrors().assertValue(token -> "success".equals(token.getValue())); OAuth2Request result = oauth2RequestCaptor.getValue(); assertTrue(USER_ID.equals(result.getSubject())); assertTrue(assertNominalPermissions(result.getPermissions())); assertTrue(result.isSupportRefreshToken()); }
@Override public Single<Token> grant(TokenRequest tokenRequest, Client client) { return parseRequest(tokenRequest, client) .flatMapMaybe(tokenRequest1 -> resolveResourceOwner(tokenRequest, client)) .map(Optional::of) .defaultIfEmpty(Optional.empty()) .flatMapSingle(user -> handleRequest(tokenRequest, client, user.orElse(null))); }
UMATokenGranter extends AbstractTokenGranter { @Override public Single<Token> grant(TokenRequest tokenRequest, Client client) { return parseRequest(tokenRequest, client) .flatMapMaybe(tokenRequest1 -> resolveResourceOwner(tokenRequest, client)) .map(Optional::of) .defaultIfEmpty(Optional.empty()) .flatMapSingle(user -> handleRequest(tokenRequest, client, user.orElse(null))); } }
UMATokenGranter extends AbstractTokenGranter { @Override public Single<Token> grant(TokenRequest tokenRequest, Client client) { return parseRequest(tokenRequest, client) .flatMapMaybe(tokenRequest1 -> resolveResourceOwner(tokenRequest, client)) .map(Optional::of) .defaultIfEmpty(Optional.empty()) .flatMapSingle(user -> handleRequest(tokenRequest, client, user.orElse(null))); } UMATokenGranter();  UMATokenGranter(TokenService tokenService,
                           UserAuthenticationManager userAuthenticationManager,
                           PermissionTicketService permissionTicketService,
                           ResourceService resourceService,
                           JWTService jwtService,
                           Domain domain,
                           RulesEngine rulesEngine,
                           ExecutionContextFactory executionContextFactory); }
UMATokenGranter extends AbstractTokenGranter { @Override public Single<Token> grant(TokenRequest tokenRequest, Client client) { return parseRequest(tokenRequest, client) .flatMapMaybe(tokenRequest1 -> resolveResourceOwner(tokenRequest, client)) .map(Optional::of) .defaultIfEmpty(Optional.empty()) .flatMapSingle(user -> handleRequest(tokenRequest, client, user.orElse(null))); } UMATokenGranter();  UMATokenGranter(TokenService tokenService,
                           UserAuthenticationManager userAuthenticationManager,
                           PermissionTicketService permissionTicketService,
                           ResourceService resourceService,
                           JWTService jwtService,
                           Domain domain,
                           RulesEngine rulesEngine,
                           ExecutionContextFactory executionContextFactory); @Override boolean handle(String grantType, Client client); @Override Single<Token> grant(TokenRequest tokenRequest, Client client); }
UMATokenGranter extends AbstractTokenGranter { @Override public Single<Token> grant(TokenRequest tokenRequest, Client client) { return parseRequest(tokenRequest, client) .flatMapMaybe(tokenRequest1 -> resolveResourceOwner(tokenRequest, client)) .map(Optional::of) .defaultIfEmpty(Optional.empty()) .flatMapSingle(user -> handleRequest(tokenRequest, client, user.orElse(null))); } UMATokenGranter();  UMATokenGranter(TokenService tokenService,
                           UserAuthenticationManager userAuthenticationManager,
                           PermissionTicketService permissionTicketService,
                           ResourceService resourceService,
                           JWTService jwtService,
                           Domain domain,
                           RulesEngine rulesEngine,
                           ExecutionContextFactory executionContextFactory); @Override boolean handle(String grantType, Client client); @Override Single<Token> grant(TokenRequest tokenRequest, Client client);  }