Search in sources :

Example 6 with OAuth2Service

use of org.wso2.carbon.identity.oauth2.OAuth2Service in project identity-inbound-auth-oauth by wso2-extensions.

the class OAuth2AuthzEndpoint method getTokenBinder.

private Optional<TokenBinder> getTokenBinder(String clientId) throws OAuthSystemException {
    OAuthAppDO oAuthAppDO;
    try {
        oAuthAppDO = OAuth2Util.getAppInformationByClientId(clientId);
    } catch (IdentityOAuth2Exception | InvalidOAuthClientException e) {
        throw new OAuthSystemException("Failed to retrieve OAuth application with client id: " + clientId, e);
    }
    if (oAuthAppDO == null || StringUtils.isBlank(oAuthAppDO.getTokenBindingType())) {
        return Optional.empty();
    }
    OAuth2Service oAuth2Service = getOAuth2Service();
    List<TokenBinder> supportedTokenBinders = oAuth2Service.getSupportedTokenBinders();
    if (supportedTokenBinders == null || supportedTokenBinders.isEmpty()) {
        return Optional.empty();
    }
    return supportedTokenBinders.stream().filter(t -> t.getBindingType().equals(oAuthAppDO.getTokenBindingType())).findAny();
}
Also used : StringUtils(org.apache.commons.lang.StringUtils) OAuthServerConfiguration(org.wso2.carbon.identity.oauth.config.OAuthServerConfiguration) Arrays(java.util.Arrays) Produces(javax.ws.rs.Produces) AuthorizationGrantCache(org.wso2.carbon.identity.oauth.cache.AuthorizationGrantCache) Enumeration(java.util.Enumeration) FrameworkConstants(org.wso2.carbon.identity.application.authentication.framework.util.FrameworkConstants) IdentityOAuth2ScopeException(org.wso2.carbon.identity.oauth2.IdentityOAuth2ScopeException) CarbonOAuthAuthzRequest(org.wso2.carbon.identity.oauth2.model.CarbonOAuthAuthzRequest) JSONException(org.json.JSONException) MediaType(javax.ws.rs.core.MediaType) OAuthError(org.apache.oltu.oauth2.common.error.OAuthError) AuthenticationResult(org.wso2.carbon.identity.application.authentication.framework.model.AuthenticationResult) Map(java.util.Map) SessionDataCacheEntry(org.wso2.carbon.identity.oauth.cache.SessionDataCacheEntry) OpenIDConnectClaimFilterImpl(org.wso2.carbon.identity.openidconnect.OpenIDConnectClaimFilterImpl) NONCE(org.wso2.carbon.identity.openidconnect.model.Constants.NONCE) ServiceURLBuilder(org.wso2.carbon.identity.core.ServiceURLBuilder) OpenIDConnectUserRPStore(org.wso2.carbon.identity.oauth.endpoint.util.OpenIDConnectUserRPStore) OIDCRequestObjectUtil(org.wso2.carbon.identity.openidconnect.OIDCRequestObjectUtil) OAuth2Util(org.wso2.carbon.identity.oauth2.util.OAuth2Util) URIBuilder(org.apache.http.client.utils.URIBuilder) AuthenticatorFlowStatus(org.wso2.carbon.identity.application.authentication.framework.AuthenticatorFlowStatus) SCOPE(org.wso2.carbon.identity.openidconnect.model.Constants.SCOPE) InvalidRequestException(org.wso2.carbon.identity.oauth.endpoint.exception.InvalidRequestException) EndpointUtil.validateParams(org.wso2.carbon.identity.oauth.endpoint.util.EndpointUtil.validateParams) Set(java.util.Set) SignedJWT(com.nimbusds.jwt.SignedJWT) StandardCharsets(java.nio.charset.StandardCharsets) InvalidOAuthClientException(org.wso2.carbon.identity.oauth.common.exception.InvalidOAuthClientException) REQUESTED_CLAIMS(org.wso2.carbon.identity.application.authentication.endpoint.util.Constants.REQUESTED_CLAIMS) UserIdNotFoundException(org.wso2.carbon.identity.application.authentication.framework.exception.UserIdNotFoundException) ConsentHandlingFailedException(org.wso2.carbon.identity.oauth.endpoint.exception.ConsentHandlingFailedException) PASSTHROUGH_TO_COMMONAUTH(org.wso2.carbon.identity.oauth.endpoint.state.OAuthAuthorizeState.PASSTHROUGH_TO_COMMONAUTH) LogFactory(org.apache.commons.logging.LogFactory) TENANT_DOMAIN(org.wso2.carbon.identity.application.authentication.framework.util.FrameworkConstants.RequestParams.TENANT_DOMAIN) REQUEST_PARAM_SP(org.wso2.carbon.identity.application.authentication.framework.util.FrameworkConstants.REQUEST_PARAM_SP) RequestedClaim(org.wso2.carbon.identity.openidconnect.model.RequestedClaim) GET(javax.ws.rs.GET) HttpRequestHeaderHandler(org.wso2.carbon.identity.oauth2.model.HttpRequestHeaderHandler) OAuthRequestWrapper(org.wso2.carbon.identity.oauth.endpoint.OAuthRequestWrapper) EndpointUtil.getOAuthServerConfiguration(org.wso2.carbon.identity.oauth.endpoint.util.EndpointUtil.getOAuthServerConfiguration) ArrayList(java.util.ArrayList) InvalidRequestParentException(org.wso2.carbon.identity.oauth.endpoint.exception.InvalidRequestParentException) ClaimMetadataException(org.wso2.carbon.identity.claim.metadata.mgt.exception.ClaimMetadataException) HttpServletRequest(javax.servlet.http.HttpServletRequest) Encode(org.owasp.encoder.Encode) RequestObject(org.wso2.carbon.identity.openidconnect.model.RequestObject) IdentityOAuthAdminException(org.wso2.carbon.identity.oauth.IdentityOAuthAdminException) RequestObjectException(org.wso2.carbon.identity.oauth2.RequestObjectException) IdentityOAuth2Exception(org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception) CommonAuthRequestWrapper(org.wso2.carbon.identity.application.authentication.framework.model.CommonAuthRequestWrapper) IdentityTenantUtil(org.wso2.carbon.identity.core.util.IdentityTenantUtil) LinkedHashSet(java.util.LinkedHashSet) MAX_AGE(org.wso2.carbon.identity.openidconnect.model.Constants.MAX_AGE) Files(java.nio.file.Files) ID_TOKEN_HINT(org.wso2.carbon.identity.openidconnect.model.Constants.ID_TOKEN_HINT) IOException(java.io.IOException) AUTHENTICATION_RESPONSE(org.wso2.carbon.identity.oauth.endpoint.state.OAuthAuthorizeState.AUTHENTICATION_RESPONSE) USER_CLAIMS_CONSENT_ONLY(org.wso2.carbon.identity.application.authentication.endpoint.util.Constants.USER_CLAIMS_CONSENT_ONLY) STATE(org.wso2.carbon.identity.openidconnect.model.Constants.STATE) EndpointUtil.getErrorPageURL(org.wso2.carbon.identity.oauth.endpoint.util.EndpointUtil.getErrorPageURL) OAuthMessage(org.wso2.carbon.identity.oauth.endpoint.message.OAuthMessage) Paths(java.nio.file.Paths) PROMPT(org.wso2.carbon.identity.openidconnect.model.Constants.PROMPT) ServletException(javax.servlet.ServletException) OAuth(org.apache.oltu.oauth2.common.OAuth) SessionDataCacheKey(org.wso2.carbon.identity.oauth.cache.SessionDataCacheKey) URISyntaxException(java.net.URISyntaxException) HttpServletRequestWrapper(javax.servlet.http.HttpServletRequestWrapper) Path(javax.ws.rs.Path) Scanner(java.util.Scanner) AUTH_TIME(org.wso2.carbon.identity.openidconnect.model.Constants.AUTH_TIME) JSONObject(org.json.JSONObject) OIDCConstants(org.wso2.carbon.identity.openidconnect.OIDCConstants) USER_CONSENT_RESPONSE(org.wso2.carbon.identity.oauth.endpoint.state.OAuthAuthorizeState.USER_CONSENT_RESPONSE) OAuth2ErrorCodes(org.wso2.carbon.identity.oauth.common.OAuth2ErrorCodes) Consumes(javax.ws.rs.Consumes) LOGIN_HINT(org.wso2.carbon.identity.openidconnect.model.Constants.LOGIN_HINT) URLBuilderException(org.wso2.carbon.identity.core.URLBuilderException) URI(java.net.URI) ParseException(java.text.ParseException) INITIAL_REQUEST(org.wso2.carbon.identity.oauth.endpoint.state.OAuthAuthorizeState.INITIAL_REQUEST) EndpointUtil.getOAuth2Service(org.wso2.carbon.identity.oauth.endpoint.util.EndpointUtil.getOAuth2Service) OIDCSessionState(org.wso2.carbon.identity.oidc.session.OIDCSessionState) AuthenticationResultCacheEntry(org.wso2.carbon.identity.application.authentication.framework.cache.AuthenticationResultCacheEntry) Context(javax.ws.rs.core.Context) EndpointUtil.retrieveStateForErrorURL(org.wso2.carbon.identity.oauth.endpoint.util.EndpointUtil.retrieveStateForErrorURL) OAuth2Parameters(org.wso2.carbon.identity.oauth2.model.OAuth2Parameters) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) OAuthASResponse(org.apache.oltu.oauth2.as.response.OAuthASResponse) OAuth2AuthorizeRespDTO(org.wso2.carbon.identity.oauth2.dto.OAuth2AuthorizeRespDTO) CommonAuthResponseWrapper(org.wso2.carbon.identity.application.authentication.framework.model.CommonAuthResponseWrapper) UUID(java.util.UUID) ServiceProvider(org.wso2.carbon.identity.application.common.model.ServiceProvider) OIDCSessionManagementUtil(org.wso2.carbon.identity.oidc.session.util.OIDCSessionManagementUtil) List(java.util.List) IdentityConstants(org.wso2.carbon.identity.base.IdentityConstants) HttpHeaders(javax.ws.rs.core.HttpHeaders) OAuth2Service(org.wso2.carbon.identity.oauth2.OAuth2Service) Response(javax.ws.rs.core.Response) OAuthAuthzRequest(org.apache.oltu.oauth2.as.request.OAuthAuthzRequest) Optional(java.util.Optional) CommonAuthenticationHandler(org.wso2.carbon.identity.application.authentication.framework.CommonAuthenticationHandler) SSOConsentServiceException(org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.consent.exception.SSOConsentServiceException) NameValuePair(org.apache.http.NameValuePair) AuthHistory(org.wso2.carbon.identity.application.authentication.framework.context.AuthHistory) FrameworkUtils(org.wso2.carbon.identity.application.authentication.framework.util.FrameworkUtils) OAuth2ClientValidationResponseDTO(org.wso2.carbon.identity.oauth2.dto.OAuth2ClientValidationResponseDTO) UnsupportedEncodingException(java.io.UnsupportedEncodingException) EndpointUtil.getSSOConsentService(org.wso2.carbon.identity.oauth.endpoint.util.EndpointUtil.getSSOConsentService) ServiceProviderProperty(org.wso2.carbon.identity.application.common.model.ServiceProviderProperty) OAuthProblemException(org.apache.oltu.oauth2.common.exception.OAuthProblemException) REDIRECT_URI(org.wso2.carbon.identity.oauth.common.OAuthConstants.OAuth20Params.REDIRECT_URI) SessionContext(org.wso2.carbon.identity.application.authentication.framework.context.SessionContext) OAuthAppDO(org.wso2.carbon.identity.oauth.dao.OAuthAppDO) HashMap(java.util.HashMap) EndpointUtil(org.wso2.carbon.identity.oauth.endpoint.util.EndpointUtil) Claim(org.wso2.carbon.identity.application.common.model.Claim) HashSet(java.util.HashSet) CarbonUtils(org.wso2.carbon.utils.CarbonUtils) ClaimMapping(org.wso2.carbon.identity.application.common.model.ClaimMapping) CollectionUtils(org.apache.commons.collections.CollectionUtils) OAuthResponse(org.apache.oltu.oauth2.common.message.OAuthResponse) ExternalClaim(org.wso2.carbon.identity.claim.metadata.mgt.model.ExternalClaim) LoggerUtils(org.wso2.carbon.identity.central.log.mgt.utils.LoggerUtils) OAuthErrorDTO(org.wso2.carbon.identity.oauth.dto.OAuthErrorDTO) ClaimMetaData(org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.consent.ClaimMetaData) SessionDataCache(org.wso2.carbon.identity.oauth.cache.SessionDataCache) Cookie(javax.servlet.http.Cookie) ConsentClaimsData(org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.consent.ConsentClaimsData) UUIDGenerator(org.wso2.carbon.registry.core.utils.UUIDGenerator) EndpointUtil.getLoginPageURL(org.wso2.carbon.identity.oauth.endpoint.util.EndpointUtil.getLoginPageURL) DISPLAY(org.wso2.carbon.identity.openidconnect.model.Constants.DISPLAY) IdentityOAuth2ClientException(org.wso2.carbon.identity.oauth2.IdentityOAuth2ClientException) POST(javax.ws.rs.POST) MapUtils(org.apache.commons.collections.MapUtils) OAuthConstants(org.wso2.carbon.identity.oauth.common.OAuthConstants) HttpServletResponse(javax.servlet.http.HttpServletResponse) OAuth2AuthorizeReqDTO(org.wso2.carbon.identity.oauth2.dto.OAuth2AuthorizeReqDTO) ClaimMetadataHandler(org.wso2.carbon.identity.claim.metadata.mgt.ClaimMetadataHandler) AuthorizationGrantCacheEntry(org.wso2.carbon.identity.oauth.cache.AuthorizationGrantCacheEntry) AuthorizationGrantCacheKey(org.wso2.carbon.identity.oauth.cache.AuthorizationGrantCacheKey) MANDATORY_CLAIMS(org.wso2.carbon.identity.application.authentication.endpoint.util.Constants.MANDATORY_CLAIMS) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) MultivaluedMap(javax.ws.rs.core.MultivaluedMap) TokenBinder(org.wso2.carbon.identity.oauth2.token.bindings.TokenBinder) URLEncoder(java.net.URLEncoder) AuthenticatedUser(org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser) OAuthSystemException(org.apache.oltu.oauth2.common.exception.OAuthSystemException) StringJoiner(java.util.StringJoiner) IdentityUtil(org.wso2.carbon.identity.core.util.IdentityUtil) Log(org.apache.commons.logging.Log) DigestUtils(org.apache.commons.codec.digest.DigestUtils) Collections(java.util.Collections) ArrayUtils(org.apache.commons.lang.ArrayUtils) EndpointUtil.getOAuth2Service(org.wso2.carbon.identity.oauth.endpoint.util.EndpointUtil.getOAuth2Service) OAuth2Service(org.wso2.carbon.identity.oauth2.OAuth2Service) OAuthAppDO(org.wso2.carbon.identity.oauth.dao.OAuthAppDO) IdentityOAuth2Exception(org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception) OAuthSystemException(org.apache.oltu.oauth2.common.exception.OAuthSystemException) InvalidOAuthClientException(org.wso2.carbon.identity.oauth.common.exception.InvalidOAuthClientException) TokenBinder(org.wso2.carbon.identity.oauth2.token.bindings.TokenBinder)

Example 7 with OAuth2Service

use of org.wso2.carbon.identity.oauth2.OAuth2Service in project identity-inbound-auth-oauth by wso2-extensions.

the class OAuth2AuthzEndpointTest method mockEndpointUtil.

private void mockEndpointUtil(boolean isConsentMgtEnabled) throws Exception {
    spy(EndpointUtil.class);
    doReturn(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME).when(EndpointUtil.class, "getSPTenantDomainFromClientId", anyString());
    doReturn(oAuth2Service).when(EndpointUtil.class, "getOAuth2Service");
    doReturn(oAuthServerConfiguration).when(EndpointUtil.class, "getOAuthServerConfiguration");
    doReturn(USER_CONSENT_URL).when(EndpointUtil.class, "getUserConsentURL", any(OAuth2Parameters.class), anyString(), anyString(), anyBoolean(), any(OAuthMessage.class));
    doReturn(LOGIN_PAGE_URL).when(EndpointUtil.class, "getLoginPageURL", anyString(), anyString(), anyBoolean(), anyBoolean(), anySet(), anyMap(), any());
    doReturn(requestObjectService).when(EndpointUtil.class, "getRequestObjectService");
    EndpointUtil.setOAuthAdminService(oAuthAdminService);
    EndpointUtil.setOAuth2ScopeService(oAuth2ScopeService);
    // TODO: Remove mocking consentUtil and test the consent flow as well
    // https://github.com/wso2/product-is/issues/2679
    SSOConsentService ssoConsentService = mock(SSOConsentService.class);
    when(ssoConsentService.getConsentRequiredClaimsWithExistingConsents(any(ServiceProvider.class), any(AuthenticatedUser.class))).thenReturn(new ConsentClaimsData());
    when(ssoConsentService.getConsentRequiredClaimsWithoutExistingConsents(any(ServiceProvider.class), any(AuthenticatedUser.class))).thenReturn(new ConsentClaimsData());
    when(ssoConsentService.isSSOConsentManagementEnabled(any())).thenReturn(isConsentMgtEnabled);
    doReturn(ssoConsentService).when(EndpointUtil.class, "getSSOConsentService");
}
Also used : OAuth2Parameters(org.wso2.carbon.identity.oauth2.model.OAuth2Parameters) OAuthMessage(org.wso2.carbon.identity.oauth.endpoint.message.OAuthMessage) ServiceProvider(org.wso2.carbon.identity.application.common.model.ServiceProvider) ConsentClaimsData(org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.consent.ConsentClaimsData) SSOConsentService(org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.consent.SSOConsentService) AuthenticatedUser(org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser)

Example 8 with OAuth2Service

use of org.wso2.carbon.identity.oauth2.OAuth2Service in project identity-inbound-auth-oauth by wso2-extensions.

the class OAuth2TokenEndpointTest method testTokenErrorResponse.

@Test(dataProvider = "testTokenErrorResponseDataProvider", groups = "testWithConnection")
public void testTokenErrorResponse(String errorCode, Object headerObj, int expectedStatus, String expectedErrorCode) throws Exception {
    ResponseHeader[] responseHeaders = (ResponseHeader[]) headerObj;
    Map<String, String[]> requestParams = new HashMap<>();
    requestParams.put(OAuth.OAUTH_GRANT_TYPE, new String[] { GrantType.PASSWORD.toString() });
    requestParams.put(OAuth.OAUTH_USERNAME, new String[] { USERNAME });
    requestParams.put(OAuth.OAUTH_PASSWORD, new String[] { "password" });
    mockStatic(LoggerUtils.class);
    when(LoggerUtils.isDiagnosticLogsEnabled()).thenReturn(true);
    mockStatic(IdentityTenantUtil.class);
    when(IdentityTenantUtil.getTenantId(anyString())).thenReturn(-1234);
    HttpServletRequest request = mockHttpRequest(requestParams, new HashMap<String, Object>());
    when(request.getHeader(OAuthConstants.HTTP_REQ_HEADER_AUTHZ)).thenReturn(AUTHORIZATION_HEADER);
    when(request.getHeaderNames()).thenReturn(Collections.enumeration(new ArrayList<String>() {

        {
            add(OAuthConstants.HTTP_REQ_HEADER_AUTHZ);
        }
    }));
    spy(EndpointUtil.class);
    doReturn(REALM).when(EndpointUtil.class, "getRealmInfo");
    doReturn(oAuth2Service).when(EndpointUtil.class, "getOAuth2Service");
    when(oAuth2Service.issueAccessToken(any(OAuth2AccessTokenReqDTO.class))).thenReturn(oAuth2AccessTokenRespDTO);
    when(oAuth2AccessTokenRespDTO.getErrorMsg()).thenReturn("Token Response error");
    when(oAuth2AccessTokenRespDTO.getErrorCode()).thenReturn(errorCode);
    when(oAuth2AccessTokenRespDTO.getResponseHeaders()).thenReturn(responseHeaders);
    mockOAuthServerConfiguration();
    mockStatic(IdentityDatabaseUtil.class);
    when(IdentityDatabaseUtil.getDBConnection()).thenReturn(connection);
    Map<String, Class<? extends OAuthValidator<HttpServletRequest>>> grantTypeValidators = new Hashtable<>();
    grantTypeValidators.put(GrantType.PASSWORD.toString(), PasswordValidator.class);
    when(oAuthServerConfiguration.getSupportedGrantTypeValidators()).thenReturn(grantTypeValidators);
    when(oAuth2Service.getOauthApplicationState(CLIENT_ID_VALUE)).thenReturn("ACTIVE");
    Response response;
    try {
        response = oAuth2TokenEndpoint.issueAccessToken(request, new MultivaluedHashMap<String, String>());
    } catch (InvalidRequestParentException ire) {
        InvalidRequestExceptionMapper invalidRequestExceptionMapper = new InvalidRequestExceptionMapper();
        response = invalidRequestExceptionMapper.toResponse(ire);
    }
    assertNotNull(response, "Token response is null");
    assertEquals(response.getStatus(), expectedStatus, "Unexpected HTTP response status");
    assertNotNull(response.getEntity(), "Response entity is null");
    assertTrue(response.getEntity().toString().contains(expectedErrorCode), "Expected error code not found");
}
Also used : ResponseHeader(org.wso2.carbon.identity.oauth2.ResponseHeader) HashMap(java.util.HashMap) MultivaluedHashMap(javax.ws.rs.core.MultivaluedHashMap) Hashtable(java.util.Hashtable) ArrayList(java.util.ArrayList) Matchers.anyString(org.mockito.Matchers.anyString) OAuth2AccessTokenReqDTO(org.wso2.carbon.identity.oauth2.dto.OAuth2AccessTokenReqDTO) HttpServletRequest(javax.servlet.http.HttpServletRequest) Response(javax.ws.rs.core.Response) HttpServletResponse(javax.servlet.http.HttpServletResponse) MultivaluedHashMap(javax.ws.rs.core.MultivaluedHashMap) InvalidRequestParentException(org.wso2.carbon.identity.oauth.endpoint.exception.InvalidRequestParentException) InvalidRequestExceptionMapper(org.wso2.carbon.identity.oauth.endpoint.expmapper.InvalidRequestExceptionMapper) OAuthValidator(org.apache.oltu.oauth2.common.validators.OAuthValidator) Test(org.testng.annotations.Test) AfterTest(org.testng.annotations.AfterTest) BeforeTest(org.testng.annotations.BeforeTest) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 9 with OAuth2Service

use of org.wso2.carbon.identity.oauth2.OAuth2Service in project identity-inbound-auth-oauth by wso2-extensions.

the class EndpointUtilTest method mockPrivilegedCarbonContext.

private void mockPrivilegedCarbonContext() {
    mockStatic(PrivilegedCarbonContext.class);
    when(PrivilegedCarbonContext.getThreadLocalCarbonContext()).thenReturn(mockedPrivilegedCarbonContext);
    when(mockedPrivilegedCarbonContext.getOSGiService(OAuthServerConfiguration.class, null)).thenReturn(mockedOAuthServerConfiguration);
    when(mockedPrivilegedCarbonContext.getOSGiService(WebFingerProcessor.class, null)).thenReturn(DefaultWebFingerProcessor.getInstance());
    when(mockedPrivilegedCarbonContext.getOSGiService(OIDCProviderRequestBuilder.class, null)).thenReturn(new DefaultOIDCProviderRequestBuilder());
    when(mockedPrivilegedCarbonContext.getOSGiService(OIDCProcessor.class, null)).thenReturn(DefaultOIDCProcessor.getInstance());
    when(mockedPrivilegedCarbonContext.getOSGiService(OAuth2Service.class, null)).thenReturn(new OAuth2Service());
    when(mockedPrivilegedCarbonContext.getOSGiService(OAuth2TokenValidationService.class, null)).thenReturn(new OAuth2TokenValidationService());
}
Also used : OAuth2Service(org.wso2.carbon.identity.oauth2.OAuth2Service) DefaultOIDCProviderRequestBuilder(org.wso2.carbon.identity.discovery.builders.DefaultOIDCProviderRequestBuilder) OAuth2TokenValidationService(org.wso2.carbon.identity.oauth2.OAuth2TokenValidationService)

Aggregations

HashMap (java.util.HashMap)5 HttpServletRequest (javax.servlet.http.HttpServletRequest)5 ArrayList (java.util.ArrayList)4 HttpServletResponse (javax.servlet.http.HttpServletResponse)4 Response (javax.ws.rs.core.Response)4 InvalidRequestParentException (org.wso2.carbon.identity.oauth.endpoint.exception.InvalidRequestParentException)4 OAuth2Service (org.wso2.carbon.identity.oauth2.OAuth2Service)4 Hashtable (java.util.Hashtable)3 MultivaluedHashMap (javax.ws.rs.core.MultivaluedHashMap)3 Matchers.anyString (org.mockito.Matchers.anyString)3 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)3 BeforeTest (org.testng.annotations.BeforeTest)3 Test (org.testng.annotations.Test)3 OAuthServerConfiguration (org.wso2.carbon.identity.oauth.config.OAuthServerConfiguration)3 Map (java.util.Map)2 OAuthValidator (org.apache.oltu.oauth2.common.validators.OAuthValidator)2 InvocationOnMock (org.mockito.invocation.InvocationOnMock)2 AfterTest (org.testng.annotations.AfterTest)2 ConsentClaimsData (org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.consent.ConsentClaimsData)2 AuthenticatedUser (org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser)2