gluu
公開メンバ関数 | 静的公開メンバ関数 | 静的公開変数類 | 限定公開変数類 | 非公開変数類 | 全メンバ一覧
org.xdi.oxauth.ws.rs.RegistrationRestWebServiceHttpTest クラス
org.xdi.oxauth.ws.rs.RegistrationRestWebServiceHttpTest の継承関係図
Inheritance graph
org.xdi.oxauth.ws.rs.RegistrationRestWebServiceHttpTest 連携図
Collaboration graph

公開メンバ関数

void requestClientAssociate1 (final String redirectUris, final String sectorIdentifierUri) throws Exception
 
void requestClientAssociate2 (final String redirectUris, final String sectorIdentifierUri, final String logoutUri) throws Exception
 
void requestClientUpdate () throws Exception
 
void requestClientRead () throws Exception
 
void requestClientAssociate3 (final String redirectUris, final String sectorIdentifierUri, final String logoutUri) throws Exception
 
void requestClientUpdate3 () throws Exception
 
void requestClientRegistrationWithCustomAttributes (final String redirectUris, final String sectorIdentifierUri) throws Exception
 
void requestClientRegistrationFail1 () throws Exception
 
void requestClientRegistrationFail2 () throws Exception
 
void requestClientRegistrationFail3 () throws Exception
 
void requestClientRegistrationFail4 (final String redirectUris) throws Exception
 
void registerWithCustomURI (final String redirectUris) throws Exception
 
void registerWithApplicationTypeNativeAndSubjectTypePairwise (final String redirectUris, final String sectorIdentifierUri) throws Exception
 
void registerWithHttp1 (final String redirectUris) throws Exception
 
void registerWithHttp2 (final String redirectUris) throws Exception
 
void registerWithHttpFail (final String redirectUris) throws Exception
 
void initTestSuite (ITestContext context) throws FileNotFoundException, IOException
 
WebDriver getDriver ()
 
void setDriver (WebDriver driver)
 
String getAuthorizationEndpoint ()
 
void setAuthorizationEndpoint (String authorizationEndpoint)
 
String getTokenEndpoint ()
 
void setTokenEndpoint (String tokenEndpoint)
 
String getUserInfoEndpoint ()
 
void setUserInfoEndpoint (String userInfoEndpoint)
 
String getClientInfoEndpoint ()
 
void setClientInfoEndpoint (String clientInfoEndpoint)
 
String getCheckSessionIFrame ()
 
void setCheckSessionIFrame (String checkSessionIFrame)
 
String getEndSessionEndpoint ()
 
void setEndSessionEndpoint (String endSessionEndpoint)
 
String getJwksUri ()
 
void setJwksUri (String jwksUri)
 
String getRegistrationEndpoint ()
 
void setRegistrationEndpoint (String registrationEndpoint)
 
String getIntrospectionEndpoint ()
 
void setIntrospectionEndpoint (String p_introspectionEndpoint)
 
Map< String, List< String > > getScopeToClaimsMapping ()
 
void setScopeToClaimsMapping (Map< String, List< String >> p_scopeToClaimsMapping)
 
String getIdGenEndpoint ()
 
void setIdGenEndpoint (String p_idGenEndpoint)
 
String getConfigurationEndpoint ()
 
void setConfigurationEndpoint (String configurationEndpoint)
 
void startSelenium ()
 
void stopSelenium ()
 
AuthorizationResponse authenticateResourceOwnerAndGrantAccess (String authorizeUrl, AuthorizationRequest authorizationRequest, String userId, String userSecret)
 
AuthorizationResponse authenticateResourceOwnerAndGrantAccess (String authorizeUrl, AuthorizationRequest authorizationRequest, String userId, String userSecret, boolean cleanupCookies)
 
AuthorizationResponse authenticateResourceOwnerAndGrantAccess (String authorizeUrl, AuthorizationRequest authorizationRequest, String userId, String userSecret, boolean cleanupCookies, boolean useNewDriver)
 
AuthorizationResponse authenticateResourceOwnerAndGrantAccess (String authorizeUrl, AuthorizationRequest authorizationRequest, String userId, String userSecret, boolean cleanupCookies, boolean useNewDriver, int authzSteps)
 
AuthorizationResponse authenticateResourceOwnerAndDenyAccess (String authorizeUrl, AuthorizationRequest authorizationRequest, String userId, String userSecret)
 
AuthorizationResponse authorizationRequestAndGrantAccess (String authorizeUrl, AuthorizationRequest authorizationRequest)
 
AuthorizationResponse authorizationRequestAndDenyAccess (String authorizeUrl, AuthorizationRequest authorizationRequest)
 
AuthorizationResponse authenticateResourceOwner (String authorizeUrl, AuthorizationRequest authorizationRequest, String userId, String userSecret, boolean cleanupCookies)
 
String waitForResourceOwnerAndGrantLoginForm (String authorizeUrl, AuthorizationRequest authorizationRequest, boolean cleanupCookies)
 
String waitForResourceOwnerAndGrantLoginForm (String authorizeUrl, AuthorizationRequest authorizationRequest)
 
void discovery (ITestContext context) throws Exception
 
void showTitle (String title)
 
void showTitle (String title)
 
void showEntity (String entity)
 
void showResponse (String title, Response response)
 

静的公開メンバ関数

static void showClient (BaseClient client)
 
static void showClient (BaseClient client, CookieStore cookieStore)
 
static void showClientUserAgent (BaseClient client)
 
static void assertErrorResponse (BaseResponseWithErrors p_response, IErrorType p_errorType)
 
static DefaultHttpClient createHttpClient ()
 
static DefaultHttpClient createHttpClient (HostnameVerifierType p_verifierType)
 
static ClientExecutor clientExecutor () throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException
 
static ClientExecutor clientExecutor (boolean trustAll) throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException
 
static HttpClient createHttpClientTrustAll () throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException
 
static void showResponse (String title, Response response, Object entity)
 
static void fails (Throwable e)
 
static void output (String p_msg)
 
static Archive<?> createDeployment ()
 

静的公開変数類

static FileConfiguration testData
 

限定公開変数類

WebDriver driver
 
String authorizationEndpoint
 
String authorizationPageEndpoint
 
String gluuConfigurationEndpoint
 
String tokenEndpoint
 
String userInfoEndpoint
 
String clientInfoEndpoint
 
String checkSessionIFrame
 
String endSessionEndpoint
 
String jwksUri
 
String registrationEndpoint
 
String configurationEndpoint
 
String idGenEndpoint
 
String introspectionEndpoint
 
Map< String, List< String > > scopeToClaimsMapping
 

非公開変数類

String registrationAccessToken1
 
String registrationClientUri1
 
String registrationAccessToken2
 
String registrationClientUri2
 

詳解

Functional tests for Client Registration Web Services (HTTP)

著者
Javier Rojas Blum
Yuriy Zabrovarnyy
バージョン
December 7, 2017

関数詳解

◆ assertErrorResponse()

static void org.xdi.oxauth.BaseTest.assertErrorResponse ( BaseResponseWithErrors  p_response,
IErrorType  p_errorType 
)
inlinestaticinherited
787  {
788  assertEquals(p_response.getStatus(), 400, "Unexpected response code. Entity: " + p_response.getEntity());
789  assertNotNull(p_response.getEntity(), "The entity is null");
790  assertEquals(p_response.getErrorType(), p_errorType);
791  assertTrue(StringUtils.isNotBlank(p_response.getErrorDescription()));
792  }
T getErrorType()
Definition: BaseResponseWithErrors.java:48
String getEntity()
Definition: BaseResponse.java:85
int getStatus()
Definition: BaseResponse.java:49
String getErrorDescription()
Definition: BaseResponseWithErrors.java:40

◆ authenticateResourceOwner()

AuthorizationResponse org.xdi.oxauth.BaseTest.authenticateResourceOwner ( String  authorizeUrl,
AuthorizationRequest  authorizationRequest,
String  userId,
String  userSecret,
boolean  cleanupCookies 
)
inlineinherited

The authorization server authenticates the resource owner (via the user-agent) No authorization page.

556  {
557  String authorizationRequestUrl = authorizeUrl + "?" + authorizationRequest.getQueryString();
558 
559  AuthorizeClient authorizeClient = new AuthorizeClient(authorizeUrl);
560  authorizeClient.setRequest(authorizationRequest);
561 
562  System.out.println("authenticateResourceOwner: authorizationRequestUrl:" + authorizationRequestUrl);
563  startSelenium();
564  if (cleanupCookies) {
565  System.out.println("authenticateResourceOwner: Cleaning cookies");
567  }
568 // try {
569  driver.navigate().to(authorizationRequestUrl);
570 // } catch (WebDriverException ex) {
571 // if (ex.getCause() instanceof ScriptException) {
572 // System.out.println("authenticateResourceOwner: Script error: " + ex.getMessage());
573 // } else {
574 // throw ex;
575 // }
576 // }
577 
578  if (userSecret != null) {
579  if (userId != null) {
580  WebElement usernameElement = driver.findElement(By.name(loginFormUsername));
581  usernameElement.sendKeys(userId);
582  }
583 
584  WebElement passwordElement = driver.findElement(By.name(loginFormPassword));
585  passwordElement.sendKeys(userSecret);
586 
587  WebElement loginButton = driver.findElement(By.name(loginFormLoginButton));
588 
589  loginButton.click();
590  }
591 
592  String authorizationResponseStr = driver.getCurrentUrl();
593 
594  Cookie sessionStateCookie = driver.manage().getCookieNamed("session_state");
595  String sessionState = null;
596  if (sessionStateCookie != null) {
597  sessionState = sessionStateCookie.getValue();
598  }
599  System.out.println("authenticateResourceOwner: sessionState:" + sessionState);
600 
601  stopSelenium();
602 
603  AuthorizationResponse authorizationResponse = new AuthorizationResponse(authorizationResponseStr);
604  if (authorizationRequest.getRedirectUri() != null && authorizationRequest.getRedirectUri().equals(authorizationResponseStr)) {
605  authorizationResponse.setResponseMode(ResponseMode.FORM_POST);
606  }
607  authorizeClient.setResponse(authorizationResponse);
608  showClientUserAgent(authorizeClient);
609 
610  return authorizationResponse;
611  }
FORM_POST
Definition: ResponseMode.java:33
String loginFormUsername
Definition: BaseTest.java:88
String loginFormPassword
Definition: BaseTest.java:89
void deleteAllCookies()
Definition: BaseTest.java:661
void stopSelenium()
Definition: BaseTest.java:243
Definition: AuthorizeClient.java:29
Definition: ResponseMode.java:16
void startSelenium()
Definition: BaseTest.java:230
String loginFormLoginButton
Definition: BaseTest.java:90
String getRedirectUri()
Definition: AuthorizationRequest.java:184
void setResponseMode(ResponseMode responseMode)
Definition: AuthorizationResponse.java:228
void setRequest(T request)
Definition: BaseClient.java:68
void setResponse(V response)
Definition: BaseClient.java:76
WebDriver driver
Definition: BaseTest.java:70
Definition: AuthorizationResponse.java:32
String getQueryString()
Definition: AuthorizationRequest.java:486
static void showClientUserAgent(BaseClient client)
Definition: BaseTest.java:783

◆ authenticateResourceOwnerAndDenyAccess()

AuthorizationResponse org.xdi.oxauth.BaseTest.authenticateResourceOwnerAndDenyAccess ( String  authorizeUrl,
AuthorizationRequest  authorizationRequest,
String  userId,
String  userSecret 
)
inlineinherited
408  {
409  String authorizationRequestUrl = authorizeUrl + "?" + authorizationRequest.getQueryString();
410 
411  AuthorizeClient authorizeClient = new AuthorizeClient(authorizeUrl);
412  authorizeClient.setRequest(authorizationRequest);
413 
414  System.out.println("authenticateResourceOwnerAndDenyAccess: authorizationRequestUrl:" + authorizationRequestUrl);
415  startSelenium();
416  driver.navigate().to(authorizationRequestUrl);
417 
418  WebElement usernameElement = driver.findElement(By.name(loginFormUsername));
419  WebElement passwordElement = driver.findElement(By.name(loginFormPassword));
420  WebElement loginButton = driver.findElement(By.name(loginFormLoginButton));
421 
422  if (userId != null) {
423  usernameElement.sendKeys(userId);
424  }
425  passwordElement.sendKeys(userSecret);
426  loginButton.click();
427 
428  String authorizationResponseStr = driver.getCurrentUrl();
429 
430  WebElement doNotAllowButton = driver.findElement(By.id(authorizeFormDoNotAllowButton));
431 
432  final String previousURL = driver.getCurrentUrl();
433  doNotAllowButton.click();
434  WebDriverWait wait = new WebDriverWait(driver, 10);
435  wait.until(new ExpectedCondition<Boolean>() {
436  public Boolean apply(WebDriver d) {
437  return (d.getCurrentUrl() != previousURL);
438  }
439  });
440 
441  authorizationResponseStr = driver.getCurrentUrl();
442 
443  Cookie sessionIdCookie = driver.manage().getCookieNamed("session_id");
444  String sessionId = null;
445  if (sessionIdCookie != null) {
446  sessionId = sessionIdCookie.getValue();
447  }
448  System.out.println("authenticateResourceOwnerAndDenyAccess: sessionId:" + sessionId);
449 
450  stopSelenium();
451 
452  AuthorizationResponse authorizationResponse = new AuthorizationResponse(authorizationResponseStr);
453  if (authorizationRequest.getRedirectUri() != null && authorizationRequest.getRedirectUri().equals(authorizationResponseStr)) {
454  authorizationResponse.setResponseMode(ResponseMode.FORM_POST);
455  }
456  authorizationResponse.setSessionId(sessionId);
457  authorizeClient.setResponse(authorizationResponse);
458  showClientUserAgent(authorizeClient);
459 
460  return authorizationResponse;
461  }
FORM_POST
Definition: ResponseMode.java:33
String loginFormUsername
Definition: BaseTest.java:88
String loginFormPassword
Definition: BaseTest.java:89
void stopSelenium()
Definition: BaseTest.java:243
String authorizeFormDoNotAllowButton
Definition: BaseTest.java:92
void setSessionId(String p_sessionId)
Definition: AuthorizationResponse.java:212
Definition: AuthorizeClient.java:29
Definition: ResponseMode.java:16
void startSelenium()
Definition: BaseTest.java:230
String loginFormLoginButton
Definition: BaseTest.java:90
String getRedirectUri()
Definition: AuthorizationRequest.java:184
void setResponseMode(ResponseMode responseMode)
Definition: AuthorizationResponse.java:228
void setRequest(T request)
Definition: BaseClient.java:68
void setResponse(V response)
Definition: BaseClient.java:76
WebDriver driver
Definition: BaseTest.java:70
Definition: AuthorizationResponse.java:32
String getQueryString()
Definition: AuthorizationRequest.java:486
static void showClientUserAgent(BaseClient client)
Definition: BaseTest.java:783

◆ authenticateResourceOwnerAndGrantAccess() [1/4]

AuthorizationResponse org.xdi.oxauth.BaseTest.authenticateResourceOwnerAndGrantAccess ( String  authorizeUrl,
AuthorizationRequest  authorizationRequest,
String  userId,
String  userSecret 
)
inlineinherited

The authorization server authenticates the resource owner (via the user-agent) and establishes whether the resource owner grants or denies the client's access request.

253  {
254  return authenticateResourceOwnerAndGrantAccess(authorizeUrl, authorizationRequest, userId, userSecret, true);
255  }
AuthorizationResponse authenticateResourceOwnerAndGrantAccess(String authorizeUrl, AuthorizationRequest authorizationRequest, String userId, String userSecret)
Definition: BaseTest.java:252

◆ authenticateResourceOwnerAndGrantAccess() [2/4]

AuthorizationResponse org.xdi.oxauth.BaseTest.authenticateResourceOwnerAndGrantAccess ( String  authorizeUrl,
AuthorizationRequest  authorizationRequest,
String  userId,
String  userSecret,
boolean  cleanupCookies 
)
inlineinherited

The authorization server authenticates the resource owner (via the user-agent) and establishes whether the resource owner grants or denies the client's access request.

262  {
263  return authenticateResourceOwnerAndGrantAccess(authorizeUrl, authorizationRequest, userId, userSecret, cleanupCookies, false);
264  }
AuthorizationResponse authenticateResourceOwnerAndGrantAccess(String authorizeUrl, AuthorizationRequest authorizationRequest, String userId, String userSecret)
Definition: BaseTest.java:252

◆ authenticateResourceOwnerAndGrantAccess() [3/4]

AuthorizationResponse org.xdi.oxauth.BaseTest.authenticateResourceOwnerAndGrantAccess ( String  authorizeUrl,
AuthorizationRequest  authorizationRequest,
String  userId,
String  userSecret,
boolean  cleanupCookies,
boolean  useNewDriver 
)
inlineinherited

The authorization server authenticates the resource owner (via the user-agent) and establishes whether the resource owner grants or denies the client's access request.

272  {
273  return authenticateResourceOwnerAndGrantAccess(authorizeUrl, authorizationRequest, userId, userSecret, cleanupCookies, useNewDriver, 1);
274  }
AuthorizationResponse authenticateResourceOwnerAndGrantAccess(String authorizeUrl, AuthorizationRequest authorizationRequest, String userId, String userSecret)
Definition: BaseTest.java:252

◆ authenticateResourceOwnerAndGrantAccess() [4/4]

AuthorizationResponse org.xdi.oxauth.BaseTest.authenticateResourceOwnerAndGrantAccess ( String  authorizeUrl,
AuthorizationRequest  authorizationRequest,
String  userId,
String  userSecret,
boolean  cleanupCookies,
boolean  useNewDriver,
int  authzSteps 
)
inlineinherited

The authorization server authenticates the resource owner (via the user-agent) and establishes whether the resource owner grants or denies the client's access request.

282  {
283  WebDriver currentDriver = initWebDriver(useNewDriver, cleanupCookies);
284 
285  AuthorizeClient authorizeClient = processAuthentication(currentDriver, authorizeUrl, authorizationRequest,
286  userId, userSecret);
287 
288  int remainAuthzSteps = authzSteps;
289 
290  String authorizationResponseStr = null;
291  do {
292  authorizationResponseStr = acceptAuthorization(currentDriver);
293  remainAuthzSteps--;
294  } while (remainAuthzSteps >= 1);
295 
296  AuthorizationResponse authorizationResponse = buildAuthorizationResponse(authorizationRequest, useNewDriver,
297  currentDriver, authorizeClient, authorizationResponseStr);
298 
299  stopWebDriver(useNewDriver, currentDriver);
300 
301  return authorizationResponse;
302  }
AuthorizationResponse buildAuthorizationResponse(AuthorizationRequest authorizationRequest, boolean useNewDriver, WebDriver currentDriver, AuthorizeClient authorizeClient, String authorizationResponseStr)
Definition: BaseTest.java:387
String acceptAuthorization(WebDriver currentDriver)
Definition: BaseTest.java:358
AuthorizeClient processAuthentication(WebDriver currentDriver, String authorizeUrl, AuthorizationRequest authorizationRequest, String userId, String userSecret)
Definition: BaseTest.java:330
Definition: AuthorizeClient.java:29
WebDriver initWebDriver(boolean useNewDriver, boolean cleanupCookies)
Definition: BaseTest.java:304
Definition: AuthorizationResponse.java:32
void stopWebDriver(boolean useNewDriver, WebDriver currentDriver)
Definition: BaseTest.java:321

◆ authorizationRequestAndDenyAccess()

AuthorizationResponse org.xdi.oxauth.BaseTest.authorizationRequestAndDenyAccess ( String  authorizeUrl,
AuthorizationRequest  authorizationRequest 
)
inlineinherited
509  {
510  String authorizationRequestUrl = authorizeUrl + "?" + authorizationRequest.getQueryString();
511 
512  AuthorizeClient authorizeClient = new AuthorizeClient(authorizeUrl);
513  authorizeClient.setRequest(authorizationRequest);
514 
515  System.out.println("authorizationRequestAndDenyAccess: authorizationRequestUrl:" + authorizationRequestUrl);
516  startSelenium();
517  driver.navigate().to(authorizationRequestUrl);
518 
519  WebElement doNotAllowButton = driver.findElement(By.id(authorizeFormDoNotAllowButton));
520 
521  final String previousURL = driver.getCurrentUrl();
522  doNotAllowButton.click();
523  WebDriverWait wait = new WebDriverWait(driver, 10);
524  wait.until(new ExpectedCondition<Boolean>() {
525  public Boolean apply(WebDriver d) {
526  return (d.getCurrentUrl() != previousURL);
527  }
528  });
529 
530  String authorizationResponseStr = driver.getCurrentUrl();
531 
532  Cookie sessionStateCookie = driver.manage().getCookieNamed("session_state");
533  String sessionState = null;
534  if (sessionStateCookie != null) {
535  sessionState = sessionStateCookie.getValue();
536  }
537  System.out.println("authorizationRequestAndDenyAccess: sessionState:" + sessionState);
538 
539  stopSelenium();
540 
541  AuthorizationResponse authorizationResponse = new AuthorizationResponse(authorizationResponseStr);
542  if (authorizationRequest.getRedirectUri() != null && authorizationRequest.getRedirectUri().equals(authorizationResponseStr)) {
543  authorizationResponse.setResponseMode(ResponseMode.FORM_POST);
544  }
545  authorizeClient.setResponse(authorizationResponse);
546  showClientUserAgent(authorizeClient);
547 
548  return authorizationResponse;
549  }
FORM_POST
Definition: ResponseMode.java:33
void stopSelenium()
Definition: BaseTest.java:243
String authorizeFormDoNotAllowButton
Definition: BaseTest.java:92
Definition: AuthorizeClient.java:29
Definition: ResponseMode.java:16
void startSelenium()
Definition: BaseTest.java:230
String getRedirectUri()
Definition: AuthorizationRequest.java:184
void setResponseMode(ResponseMode responseMode)
Definition: AuthorizationResponse.java:228
void setRequest(T request)
Definition: BaseClient.java:68
void setResponse(V response)
Definition: BaseClient.java:76
WebDriver driver
Definition: BaseTest.java:70
Definition: AuthorizationResponse.java:32
String getQueryString()
Definition: AuthorizationRequest.java:486
static void showClientUserAgent(BaseClient client)
Definition: BaseTest.java:783

◆ authorizationRequestAndGrantAccess()

AuthorizationResponse org.xdi.oxauth.BaseTest.authorizationRequestAndGrantAccess ( String  authorizeUrl,
AuthorizationRequest  authorizationRequest 
)
inlineinherited
464  {
465  String authorizationRequestUrl = authorizeUrl + "?" + authorizationRequest.getQueryString();
466 
467  AuthorizeClient authorizeClient = new AuthorizeClient(authorizeUrl);
468  authorizeClient.setRequest(authorizationRequest);
469 
470  System.out.println("authorizationRequestAndGrantAccess: authorizationRequestUrl:" + authorizationRequestUrl);
471  startSelenium();
472  driver.navigate().to(authorizationRequestUrl);
473 
474  String authorizationResponseStr = driver.getCurrentUrl();
475 
476  WebElement allowButton = driver.findElement(By.id(authorizeFormAllowButton));
477 
478  final String previousURL = driver.getCurrentUrl();
479  allowButton.click();
480  WebDriverWait wait = new WebDriverWait(driver, 10);
481  wait.until(new ExpectedCondition<Boolean>() {
482  public Boolean apply(WebDriver d) {
483  return (d.getCurrentUrl() != previousURL);
484  }
485  });
486 
487  authorizationResponseStr = driver.getCurrentUrl();
488 
489  Cookie sessionStateCookie = driver.manage().getCookieNamed("session_state");
490  String sessionState = null;
491  if (sessionStateCookie != null) {
492  sessionState = sessionStateCookie.getValue();
493  }
494  System.out.println("authorizationRequestAndGrantAccess: sessionState:" + sessionState);
495 
496  stopSelenium();
497 
498  AuthorizationResponse authorizationResponse = new AuthorizationResponse(authorizationResponseStr);
499  if (authorizationRequest.getRedirectUri() != null && authorizationRequest.getRedirectUri().equals(authorizationResponseStr)) {
500  authorizationResponse.setResponseMode(ResponseMode.FORM_POST);
501  }
502  authorizeClient.setResponse(authorizationResponse);
503  showClientUserAgent(authorizeClient);
504 
505  return authorizationResponse;
506  }
FORM_POST
Definition: ResponseMode.java:33
void stopSelenium()
Definition: BaseTest.java:243
Definition: AuthorizeClient.java:29
Definition: ResponseMode.java:16
void startSelenium()
Definition: BaseTest.java:230
String getRedirectUri()
Definition: AuthorizationRequest.java:184
void setResponseMode(ResponseMode responseMode)
Definition: AuthorizationResponse.java:228
void setRequest(T request)
Definition: BaseClient.java:68
void setResponse(V response)
Definition: BaseClient.java:76
WebDriver driver
Definition: BaseTest.java:70
Definition: AuthorizationResponse.java:32
String getQueryString()
Definition: AuthorizationRequest.java:486
static void showClientUserAgent(BaseClient client)
Definition: BaseTest.java:783
String authorizeFormAllowButton
Definition: BaseTest.java:91

◆ clientExecutor() [1/2]

static ClientExecutor org.xdi.oxauth.BaseTest.clientExecutor ( ) throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException
inlinestaticinherited
822  {
823  return clientExecutor(false);
824  }
static ClientExecutor clientExecutor()
Definition: BaseTest.java:822

◆ clientExecutor() [2/2]

static ClientExecutor org.xdi.oxauth.BaseTest.clientExecutor ( boolean  trustAll) throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException
inlinestaticinherited
826  {
827  if (trustAll) {
828  return new ApacheHttpClient4Executor(createHttpClientTrustAll());
829  }
830  return ClientRequest.getDefaultExecutor();
831  }
static HttpClient createHttpClientTrustAll()
Definition: BaseTest.java:833

◆ createDeployment()

static Archive<?> org.xdi.oxauth.ConfigurableTest.createDeployment ( )
inlinestaticinherited
40  {
41  return Deployments.createDeployment();
42  }

◆ createHttpClient() [1/2]

static DefaultHttpClient org.xdi.oxauth.BaseTest.createHttpClient ( )
inlinestaticinherited
794  {
795  return createHttpClient(HostnameVerifierType.DEFAULT);
796  }
static DefaultHttpClient createHttpClient()
Definition: BaseTest.java:794

◆ createHttpClient() [2/2]

static DefaultHttpClient org.xdi.oxauth.BaseTest.createHttpClient ( HostnameVerifierType  p_verifierType)
inlinestaticinherited
798  {
799  if (p_verifierType != null && p_verifierType != HostnameVerifierType.DEFAULT) {
800  switch (p_verifierType) {
801  case ALLOW_ALL:
802  HostnameVerifier hostnameVerifier = org.apache.http.conn.ssl.SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER;
803 
804  DefaultHttpClient client = new DefaultHttpClient();
805 
806  SchemeRegistry registry = new SchemeRegistry();
807  SSLSocketFactory socketFactory = SSLSocketFactory.getSocketFactory();
808  socketFactory.setHostnameVerifier((X509HostnameVerifier) hostnameVerifier);
809  registry.register(new Scheme("https", socketFactory, 443));
810  SingleClientConnManager mgr = new SingleClientConnManager(client.getParams(), registry);
811 
812  // Set verifier
813  HttpsURLConnection.setDefaultHostnameVerifier(hostnameVerifier);
814  return new DefaultHttpClient(mgr, client.getParams());
815  case DEFAULT:
816  return new DefaultHttpClient();
817  }
818  }
819  return new DefaultHttpClient();
820  }

◆ createHttpClientTrustAll()

static HttpClient org.xdi.oxauth.BaseTest.createHttpClientTrustAll ( ) throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException
inlinestaticinherited
833  {
834  SSLSocketFactory sf = new SSLSocketFactory(new TrustStrategy() {
835  @Override
836  public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException {
837  return true;
838  }
839  }, new AllowAllHostnameVerifier());
840 
841  SchemeRegistry registry = new SchemeRegistry();
842  registry.register(new Scheme("http", 80, PlainSocketFactory.getSocketFactory()));
843  registry.register(new Scheme("https", 443, sf));
844  ClientConnectionManager ccm = new PoolingClientConnectionManager(registry);
845  return new DefaultHttpClient(ccm);
846  }

◆ discovery()

void org.xdi.oxauth.BaseTest.discovery ( ITestContext  context) throws Exception
inlineinherited
670  {
671  // Load Form Interaction
672  loginFormUsername = context.getCurrentXmlTest().getParameter("loginFormUsername");
673  loginFormPassword = context.getCurrentXmlTest().getParameter("loginFormPassword");
674  loginFormLoginButton = context.getCurrentXmlTest().getParameter("loginFormLoginButton");
675  authorizeFormAllowButton = context.getCurrentXmlTest().getParameter("authorizeFormAllowButton");
676  authorizeFormDoNotAllowButton = context.getCurrentXmlTest().getParameter("authorizeFormDoNotAllowButton");
677 
678  String resource = context.getCurrentXmlTest().getParameter("swdResource");
679 
680  if (StringUtils.isNotBlank(resource)) {
681 
682  showTitle("OpenID Connect Discovery");
683 
684  OpenIdConnectDiscoveryClient openIdConnectDiscoveryClient = new OpenIdConnectDiscoveryClient(resource);
685  OpenIdConnectDiscoveryResponse openIdConnectDiscoveryResponse = openIdConnectDiscoveryClient.exec(clientExecutor(true));
686 
687  showClient(openIdConnectDiscoveryClient);
688  assertEquals(openIdConnectDiscoveryResponse.getStatus(), 200, "Unexpected response code");
689  assertNotNull(openIdConnectDiscoveryResponse.getSubject());
690  assertTrue(openIdConnectDiscoveryResponse.getLinks().size() > 0);
691 
692  configurationEndpoint = openIdConnectDiscoveryResponse.getLinks().get(0).getHref() +
693  "/.well-known/openid-configuration";
694 
695  System.out.println("OpenID Connect Configuration");
696 
697  OpenIdConfigurationClient client = new OpenIdConfigurationClient(configurationEndpoint);
698  client.setExecutor(clientExecutor(true));
700 
701  showClient(client);
702  assertEquals(response.getStatus(), 200, "Unexpected response code");
703  assertNotNull(response.getIssuer(), "The issuer is null");
704  assertNotNull(response.getAuthorizationEndpoint(), "The authorizationEndpoint is null");
705  assertNotNull(response.getTokenEndpoint(), "The tokenEndpoint is null");
706  assertNotNull(response.getUserInfoEndpoint(), "The userInfoEndPoint is null");
707  assertNotNull(response.getJwksUri(), "The jwksUri is null");
708  assertNotNull(response.getRegistrationEndpoint(), "The registrationEndpoint is null");
709 
710  assertTrue(response.getScopesSupported().size() > 0, "The scopesSupported is empty");
711  assertTrue(response.getScopeToClaimsMapping().size() > 0, "The scope to claims mapping is empty");
712  assertTrue(response.getResponseTypesSupported().size() > 0, "The responseTypesSupported is empty");
713  assertTrue(response.getGrantTypesSupported().size() > 0, "The grantTypesSupported is empty");
714  assertTrue(response.getAcrValuesSupported().size() >= 0, "The acrValuesSupported is empty");
715  assertTrue(response.getSubjectTypesSupported().size() > 0, "The subjectTypesSupported is empty");
716  assertTrue(response.getIdTokenSigningAlgValuesSupported().size() > 0, "The idTokenSigningAlgValuesSupported is empty");
717  assertTrue(response.getRequestObjectSigningAlgValuesSupported().size() > 0, "The requestObjectSigningAlgValuesSupported is empty");
718  assertTrue(response.getTokenEndpointAuthMethodsSupported().size() > 0, "The tokenEndpointAuthMethodsSupported is empty");
719  assertTrue(response.getClaimsSupported().size() > 0, "The claimsSupported is empty");
720 
722  tokenEndpoint = response.getTokenEndpoint();
727  jwksUri = response.getJwksUri();
732  gluuConfigurationEndpoint = determineGluuConfigurationEndpoint(openIdConnectDiscoveryResponse.getLinks().get(0).getHref());
733  } else {
734  showTitle("Loading configuration endpoints from properties file");
735 
736  authorizationEndpoint = context.getCurrentXmlTest().getParameter("authorizationEndpoint");
737  tokenEndpoint = context.getCurrentXmlTest().getParameter("tokenEndpoint");
738  userInfoEndpoint = context.getCurrentXmlTest().getParameter("userInfoEndpoint");
739  clientInfoEndpoint = context.getCurrentXmlTest().getParameter("clientInfoEndpoint");
740  checkSessionIFrame = context.getCurrentXmlTest().getParameter("checkSessionIFrame");
741  endSessionEndpoint = context.getCurrentXmlTest().getParameter("endSessionEndpoint");
742  jwksUri = context.getCurrentXmlTest().getParameter("jwksUri");
743  registrationEndpoint = context.getCurrentXmlTest().getParameter("registrationEndpoint");
744  configurationEndpoint = context.getCurrentXmlTest().getParameter("configurationEndpoint");
745  idGenEndpoint = context.getCurrentXmlTest().getParameter("idGenEndpoint");
746  introspectionEndpoint = context.getCurrentXmlTest().getParameter("introspectionEndpoint");
747  scopeToClaimsMapping = new HashMap<String, List<String>>();
748  }
749 
751  }
String registrationEndpoint
Definition: BaseTest.java:81
String getIntrospectionEndpoint()
Definition: OpenIdConfigurationResponse.java:343
List< String > getTokenEndpointAuthMethodsSupported()
Definition: OpenIdConfigurationResponse.java:642
String determineAuthorizationPageEndpoint(String authorizationEndpoint)
Definition: BaseTest.java:753
String jwksUri
Definition: BaseTest.java:80
String getRegistrationEndpoint()
Definition: OpenIdConfigurationResponse.java:310
String clientInfoEndpoint
Definition: BaseTest.java:77
String getCheckSessionIFrame()
Definition: OpenIdConfigurationResponse.java:248
String authorizationPageEndpoint
Definition: BaseTest.java:73
String idGenEndpoint
Definition: BaseTest.java:83
String getIdGenerationEndpoint()
Definition: OpenIdConfigurationResponse.java:327
static void showClient(BaseClient client)
Definition: BaseTest.java:775
List< String > getRequestObjectSigningAlgValuesSupported()
Definition: OpenIdConfigurationResponse.java:579
String loginFormUsername
Definition: BaseTest.java:88
String loginFormPassword
Definition: BaseTest.java:89
String configurationEndpoint
Definition: BaseTest.java:82
List< String > getSubjectTypesSupported()
Definition: OpenIdConfigurationResponse.java:438
String getEndSessionEndpoint()
Definition: OpenIdConfigurationResponse.java:268
String tokenEndpoint
Definition: BaseTest.java:75
String authorizeFormDoNotAllowButton
Definition: BaseTest.java:92
List< String > getAcrValuesSupported()
Definition: OpenIdConfigurationResponse.java:418
String getClientInfoEndpoint()
Definition: OpenIdConfigurationResponse.java:228
List< String > getGrantTypesSupported()
Definition: OpenIdConfigurationResponse.java:398
String checkSessionIFrame
Definition: BaseTest.java:78
void setExecutor(ClientExecutor executor)
Definition: BaseClient.java:84
OpenIdConfigurationResponse execOpenIdConfiguration()
Definition: OpenIdConfigurationClient.java:47
String loginFormLoginButton
Definition: BaseTest.java:90
String gluuConfigurationEndpoint
Definition: BaseTest.java:74
Map< String, List< String > > getScopeToClaimsMapping()
Definition: OpenIdConfigurationResponse.java:136
String getJwksUri()
Definition: OpenIdConfigurationResponse.java:289
String getTokenEndpoint()
Definition: OpenIdConfigurationResponse.java:192
List< String > getIdTokenSigningAlgValuesSupported()
Definition: OpenIdConfigurationResponse.java:519
Definition: OpenIdConnectDiscoveryClient.java:29
String introspectionEndpoint
Definition: BaseTest.java:84
void showTitle(String title)
Definition: BaseTest.java:761
List< String > getResponseTypesSupported()
Definition: OpenIdConfigurationResponse.java:378
String endSessionEndpoint
Definition: BaseTest.java:79
String getSubject()
Definition: OpenIdConnectDiscoveryResponse.java:32
List< String > getScopesSupported()
Definition: OpenIdConfigurationResponse.java:360
String determineGluuConfigurationEndpoint(String host)
Definition: BaseTest.java:757
OpenIdConnectDiscoveryResponse exec()
Definition: OpenIdConnectDiscoveryClient.java:47
String getAuthorizationEndpoint()
Definition: OpenIdConfigurationResponse.java:174
String userInfoEndpoint
Definition: BaseTest.java:76
Definition: OpenIdConfigurationClient.java:27
int getStatus()
Definition: BaseResponse.java:49
List< WebFingerLink > getLinks()
Definition: OpenIdConnectDiscoveryResponse.java:40
List< String > getClaimsSupported()
Definition: OpenIdConfigurationResponse.java:728
Definition: OpenIdConnectDiscoveryResponse.java:17
String authorizationEndpoint
Definition: BaseTest.java:72
String getUserInfoEndpoint()
Definition: OpenIdConfigurationResponse.java:210
Definition: OpenIdConfigurationResponse.java:26
static ClientExecutor clientExecutor()
Definition: BaseTest.java:822
Map< String, List< String > > scopeToClaimsMapping
Definition: BaseTest.java:85
String authorizeFormAllowButton
Definition: BaseTest.java:91
String getIssuer()
Definition: OpenIdConfigurationResponse.java:156

◆ fails()

static void org.xdi.oxauth.BaseTest.fails ( Throwable  e)
inlinestaticinherited
50  {
51  Assert.fail(e.getMessage(), e);
52  }

◆ getAuthorizationEndpoint()

String org.xdi.oxauth.BaseTest.getAuthorizationEndpoint ( )
inlineinherited
134  {
135  return authorizationEndpoint;
136  }
String authorizationEndpoint
Definition: BaseTest.java:72

◆ getCheckSessionIFrame()

String org.xdi.oxauth.BaseTest.getCheckSessionIFrame ( )
inlineinherited
166  {
167  return checkSessionIFrame;
168  }
String checkSessionIFrame
Definition: BaseTest.java:78

◆ getClientInfoEndpoint()

String org.xdi.oxauth.BaseTest.getClientInfoEndpoint ( )
inlineinherited
158  {
159  return clientInfoEndpoint;
160  }
String clientInfoEndpoint
Definition: BaseTest.java:77

◆ getConfigurationEndpoint()

String org.xdi.oxauth.BaseTest.getConfigurationEndpoint ( )
inlineinherited
222  {
223  return configurationEndpoint;
224  }
String configurationEndpoint
Definition: BaseTest.java:82

◆ getDriver()

WebDriver org.xdi.oxauth.BaseTest.getDriver ( )
inlineinherited
126  {
127  return driver;
128  }
WebDriver driver
Definition: BaseTest.java:70

◆ getEndSessionEndpoint()

String org.xdi.oxauth.BaseTest.getEndSessionEndpoint ( )
inlineinherited
174  {
175  return endSessionEndpoint;
176  }
String endSessionEndpoint
Definition: BaseTest.java:79

◆ getIdGenEndpoint()

String org.xdi.oxauth.BaseTest.getIdGenEndpoint ( )
inlineinherited
214  {
215  return idGenEndpoint;
216  }
String idGenEndpoint
Definition: BaseTest.java:83

◆ getIntrospectionEndpoint()

String org.xdi.oxauth.BaseTest.getIntrospectionEndpoint ( )
inlineinherited
198  {
199  return introspectionEndpoint;
200  }
String introspectionEndpoint
Definition: BaseTest.java:84

◆ getJwksUri()

String org.xdi.oxauth.BaseTest.getJwksUri ( )
inlineinherited
182  {
183  return jwksUri;
184  }
String jwksUri
Definition: BaseTest.java:80

◆ getRegistrationEndpoint()

String org.xdi.oxauth.BaseTest.getRegistrationEndpoint ( )
inlineinherited
190  {
191  return registrationEndpoint;
192  }
String registrationEndpoint
Definition: BaseTest.java:81

◆ getScopeToClaimsMapping()

Map<String, List<String> > org.xdi.oxauth.BaseTest.getScopeToClaimsMapping ( )
inlineinherited
206  {
207  return scopeToClaimsMapping;
208  }
Map< String, List< String > > scopeToClaimsMapping
Definition: BaseTest.java:85

◆ getTokenEndpoint()

String org.xdi.oxauth.BaseTest.getTokenEndpoint ( )
inlineinherited
142  {
143  return tokenEndpoint;
144  }
String tokenEndpoint
Definition: BaseTest.java:75

◆ getUserInfoEndpoint()

String org.xdi.oxauth.BaseTest.getUserInfoEndpoint ( )
inlineinherited
150  {
151  return userInfoEndpoint;
152  }
String userInfoEndpoint
Definition: BaseTest.java:76

◆ initTestSuite()

void org.xdi.oxauth.BaseTest.initTestSuite ( ITestContext  context) throws FileNotFoundException, IOException
inlineinherited
95  {
96  SecurityProviderUtility.installBCProvider();
97 
98  Reporter.log("Invoked init test suite method \n", true);
99 
100  String propertiesFile = context.getCurrentXmlTest().getParameter("propertiesFile");
101  if (StringHelper.isEmpty(propertiesFile)) {
102  propertiesFile = "target/test-classes/testng.properties";
103  //propertiesFile = "U:\\own\\project\\git\\oxAuth\\Client\\src\\test\\resources\\testng_yuriy.properties";
104  //propertiesFile = "/Users/JAVIER/IdeaProjects/oxAuth/Client/target/test-classes/testng.properties";
105  }
106 
107  FileInputStream conf = new FileInputStream(propertiesFile);
108  Properties prop = new Properties();
109  prop.load(conf);
110 
111  Map<String, String> parameters = new HashMap<String, String>();
112  for (Entry<Object, Object> entry : prop.entrySet()) {
113  Object key = entry.getKey();
114  Object value = entry.getValue();
115 
116  if (StringHelper.isEmptyString(key) || StringHelper.isEmptyString(value)) {
117  continue;
118  }
119  parameters.put(key.toString(), value.toString());
120  }
121 
122  // Overrided test paramters
123  context.getSuite().getXmlSuite().setParameters(parameters);
124  }

◆ output()

static void org.xdi.oxauth.BaseTest.output ( String  p_msg)
inlinestaticinherited
54  {
55  System.out.println(p_msg);
56  }

◆ registerWithApplicationTypeNativeAndSubjectTypePairwise()

void org.xdi.oxauth.ws.rs.RegistrationRestWebServiceHttpTest.registerWithApplicationTypeNativeAndSubjectTypePairwise ( final String  redirectUris,
final String  sectorIdentifierUri 
) throws Exception
inline
450  {
451  showTitle("registerWithApplicationTypeNativeAndSubjectTypePairwise");
452 
453  List<String> redirectUriList = Lists.newArrayList(StringUtils.spaceSeparatedToList(redirectUris));
454 
455  RegisterRequest registerRequest = new RegisterRequest(ApplicationType.NATIVE, "oxAuth native test app",
456  redirectUriList);
457  registerRequest.setSubjectType(SubjectType.PAIRWISE);
458  registerRequest.setSectorIdentifierUri(sectorIdentifierUri);
459 
460  RegisterClient registerClient = new RegisterClient(registrationEndpoint);
461  registerClient.setExecutor(clientExecutor(true));
462  registerClient.setRequest(registerRequest);
463  RegisterResponse response = registerClient.exec();
464 
465  showClient(registerClient);
466  assertEquals(response.getStatus(), 200, "Unexpected response code: " + response.getEntity());
467  assertNotNull(response.getClientId());
468  assertNotNull(response.getClientSecret());
469  assertNotNull(response.getRegistrationAccessToken());
470  assertNotNull(response.getClientSecretExpiresAt());
471  }
String registrationEndpoint
Definition: BaseTest.java:81
static void showClient(BaseClient client)
Definition: BaseTest.java:775
void showTitle(String title)
Definition: BaseTest.java:761
static ClientExecutor clientExecutor()
Definition: BaseTest.java:822

◆ registerWithCustomURI()

void org.xdi.oxauth.ws.rs.RegistrationRestWebServiceHttpTest.registerWithCustomURI ( final String  redirectUris) throws Exception
inline
424  {
425  showTitle("requestClientAssociate1");
426 
427  List<String> redirectUriList = Lists.newArrayList(StringUtils.spaceSeparatedToList(redirectUris));
428  redirectUriList.add("myschema://client.example.com/cb"); // URI with custom schema
429 
430  RegisterRequest registerRequest = new RegisterRequest(ApplicationType.NATIVE, "oxAuth native test app with custom schema in URI",
431  redirectUriList);
432  registerRequest.setSubjectType(SubjectType.PUBLIC);
433 
434  RegisterClient registerClient = new RegisterClient(registrationEndpoint);
435  registerClient.setExecutor(clientExecutor(true));
436  registerClient.setRequest(registerRequest);
437  RegisterResponse response = registerClient.exec();
438 
439  showClient(registerClient);
440  assertEquals(response.getStatus(), 200, "Unexpected response code: " + response.getEntity());
441  assertNotNull(response.getClientId());
442  assertNotNull(response.getClientSecret());
443  assertNotNull(response.getRegistrationAccessToken());
444  assertNotNull(response.getClientSecretExpiresAt());
445  }
String registrationEndpoint
Definition: BaseTest.java:81
static void showClient(BaseClient client)
Definition: BaseTest.java:775
void showTitle(String title)
Definition: BaseTest.java:761
static ClientExecutor clientExecutor()
Definition: BaseTest.java:822

◆ registerWithHttp1()

void org.xdi.oxauth.ws.rs.RegistrationRestWebServiceHttpTest.registerWithHttp1 ( final String  redirectUris) throws Exception
inline
475  {
476  showTitle("registerWithHttp1");
477 
478  List<String> redirectUriList = Lists.newArrayList(StringUtils.spaceSeparatedToList(redirectUris));
479  redirectUriList.add("http://localhost/cb"); // URI with HTTP schema
480 
481  RegisterRequest registerRequest = new RegisterRequest(ApplicationType.WEB, "oxAuth web test app with HTTP schema in URI",
482  redirectUriList);
483  registerRequest.setSubjectType(SubjectType.PUBLIC);
484 
485  RegisterClient registerClient = new RegisterClient(registrationEndpoint);
486  registerClient.setExecutor(clientExecutor(true));
487  registerClient.setRequest(registerRequest);
488  RegisterResponse response = registerClient.exec();
489 
490  showClient(registerClient);
491  assertEquals(response.getStatus(), 200, "Unexpected response code: " + response.getEntity());
492  assertNotNull(response.getClientId());
493  assertNotNull(response.getClientSecret());
494  assertNotNull(response.getRegistrationAccessToken());
495  assertNotNull(response.getClientSecretExpiresAt());
496  }
String registrationEndpoint
Definition: BaseTest.java:81
static void showClient(BaseClient client)
Definition: BaseTest.java:775
void showTitle(String title)
Definition: BaseTest.java:761
static ClientExecutor clientExecutor()
Definition: BaseTest.java:822

◆ registerWithHttp2()

void org.xdi.oxauth.ws.rs.RegistrationRestWebServiceHttpTest.registerWithHttp2 ( final String  redirectUris) throws Exception
inline
500  {
501  showTitle("registerWithHttp2");
502 
503  List<String> redirectUriList = Lists.newArrayList(StringUtils.spaceSeparatedToList(redirectUris));
504  redirectUriList.add("http://127.0.0.1/cb"); // URI with HTTP schema
505 
506  RegisterRequest registerRequest = new RegisterRequest(ApplicationType.WEB, "oxAuth web test app with HTTP schema in URI",
507  redirectUriList);
508  registerRequest.setSubjectType(SubjectType.PUBLIC);
509 
510  RegisterClient registerClient = new RegisterClient(registrationEndpoint);
511  registerClient.setExecutor(clientExecutor(true));
512  registerClient.setRequest(registerRequest);
513  RegisterResponse response = registerClient.exec();
514 
515  showClient(registerClient);
516  assertEquals(response.getStatus(), 200, "Unexpected response code: " + response.getEntity());
517  assertNotNull(response.getClientId());
518  assertNotNull(response.getClientSecret());
519  assertNotNull(response.getRegistrationAccessToken());
520  assertNotNull(response.getClientSecretExpiresAt());
521  }
String registrationEndpoint
Definition: BaseTest.java:81
static void showClient(BaseClient client)
Definition: BaseTest.java:775
void showTitle(String title)
Definition: BaseTest.java:761
static ClientExecutor clientExecutor()
Definition: BaseTest.java:822

◆ registerWithHttpFail()

void org.xdi.oxauth.ws.rs.RegistrationRestWebServiceHttpTest.registerWithHttpFail ( final String  redirectUris) throws Exception
inline
525  {
526  showTitle("registerWithHttpFail");
527 
528  List<String> redirectUriList = Lists.newArrayList(StringUtils.spaceSeparatedToList(redirectUris));
529  redirectUriList.add("http://www.example.com/cb"); // URI with HTTP schema
530 
531  RegisterRequest registerRequest = new RegisterRequest(ApplicationType.WEB, "oxAuth web test app with HTTP schema in URI",
532  redirectUriList);
533  registerRequest.setSubjectType(SubjectType.PUBLIC);
534 
535  RegisterClient registerClient = new RegisterClient(registrationEndpoint);
536  registerClient.setExecutor(clientExecutor(true));
537  registerClient.setRequest(registerRequest);
538  RegisterResponse response = registerClient.exec();
539 
540  showClient(registerClient);
541  assertEquals(response.getStatus(), 400);
542  assertNotNull(response.getEntity());
543  assertNotNull(response.getErrorType());
544  assertNotNull(response.getErrorDescription());
545  }
String registrationEndpoint
Definition: BaseTest.java:81
static void showClient(BaseClient client)
Definition: BaseTest.java:775
void showTitle(String title)
Definition: BaseTest.java:761
static ClientExecutor clientExecutor()
Definition: BaseTest.java:822

◆ requestClientAssociate1()

void org.xdi.oxauth.ws.rs.RegistrationRestWebServiceHttpTest.requestClientAssociate1 ( final String  redirectUris,
final String  sectorIdentifierUri 
) throws Exception
inline
49  {
50  showTitle("requestClientAssociate1");
51 
52  RegisterRequest registerRequest = new RegisterRequest(ApplicationType.WEB, "oxAuth test app",
53  StringUtils.spaceSeparatedToList(redirectUris));
54  registerRequest.setSectorIdentifierUri(sectorIdentifierUri);
55 
56  RegisterClient registerClient = new RegisterClient(registrationEndpoint);
57  registerClient.setRequest(registerRequest);
58  RegisterResponse response = registerClient.exec();
59 
60  showClient(registerClient);
61  assertEquals(response.getStatus(), 200, "Unexpected response code: " + response.getEntity());
62  assertNotNull(response.getClientId());
63  assertNotNull(response.getClientSecret());
64  assertNotNull(response.getRegistrationAccessToken());
65  assertNotNull(response.getClientSecretExpiresAt());
66  }
String registrationEndpoint
Definition: BaseTest.java:81
static void showClient(BaseClient client)
Definition: BaseTest.java:775
void showTitle(String title)
Definition: BaseTest.java:761

◆ requestClientAssociate2()

void org.xdi.oxauth.ws.rs.RegistrationRestWebServiceHttpTest.requestClientAssociate2 ( final String  redirectUris,
final String  sectorIdentifierUri,
final String  logoutUri 
) throws Exception
inline
71  {
72  showTitle("requestClientAssociate2");
73 
74  RegisterRequest registerRequest = new RegisterRequest(ApplicationType.WEB, "oxAuth test app",
75  StringUtils.spaceSeparatedToList(redirectUris));
76  registerRequest.setContacts(Arrays.asList("javier@gluu.org", "javier.rojas.blum@gmail.com"));
77  registerRequest.setScope(Arrays.asList("openid", "address", "profile", "email", "phone", "clientinfo", "invalid_scope"));
78  registerRequest.setLogoUri("http://www.gluu.org/wp-content/themes/gluursn/images/logo.png");
79  registerRequest.setTokenEndpointAuthMethod(AuthenticationMethod.CLIENT_SECRET_JWT);
80  registerRequest.setPolicyUri("http://www.gluu.org/policy");
81  registerRequest.setJwksUri("http://www.gluu.org/jwks");
82  registerRequest.setSectorIdentifierUri(sectorIdentifierUri);
83  registerRequest.setSubjectType(SubjectType.PAIRWISE);
84  registerRequest.setRequestUris(Arrays.asList("http://www.gluu.org/request"));
85  registerRequest.setFrontChannelLogoutUris(Lists.newArrayList(logoutUri));
86  registerRequest.setFrontChannelLogoutSessionRequired(true);
87  registerRequest.setIdTokenSignedResponseAlg(SignatureAlgorithm.RS512);
88  registerRequest.setIdTokenEncryptedResponseAlg(KeyEncryptionAlgorithm.RSA1_5);
89  registerRequest.setIdTokenEncryptedResponseEnc(BlockEncryptionAlgorithm.A128CBC_PLUS_HS256);
90  registerRequest.setUserInfoSignedResponseAlg(SignatureAlgorithm.RS384);
91  registerRequest.setUserInfoEncryptedResponseAlg(KeyEncryptionAlgorithm.A128KW);
92  registerRequest.setUserInfoEncryptedResponseEnc(BlockEncryptionAlgorithm.A128GCM);
93  registerRequest.setRequestObjectSigningAlg(SignatureAlgorithm.RS256);
94  registerRequest.setRequestObjectEncryptionAlg(KeyEncryptionAlgorithm.A256KW);
95  registerRequest.setRequestObjectEncryptionEnc(BlockEncryptionAlgorithm.A256CBC_PLUS_HS512);
96  registerRequest.setTokenEndpointAuthMethod(AuthenticationMethod.CLIENT_SECRET_JWT);
97  registerRequest.setTokenEndpointAuthSigningAlg(SignatureAlgorithm.ES256);
98 
99  RegisterClient registerClient = new RegisterClient(registrationEndpoint);
100  registerClient.setRequest(registerRequest);
101  registerClient.setExecutor(clientExecutor(true));
102  RegisterResponse response = registerClient.exec();
103 
104  showClient(registerClient);
105  assertEquals(response.getStatus(), 200, "Unexpected response code: " + response.getEntity());
106  assertNotNull(response.getClientId());
107  assertNotNull(response.getClientSecret());
108  assertNotNull(response.getRegistrationAccessToken());
109  assertNotNull(response.getClientSecretExpiresAt());
110  assertNotNull(response.getClaims().get(SCOPE.toString()));
111  assertNotNull(response.getClaims().get(FRONT_CHANNEL_LOGOUT_SESSION_REQUIRED.toString()));
112  assertTrue(Boolean.parseBoolean(response.getClaims().get(FRONT_CHANNEL_LOGOUT_SESSION_REQUIRED.toString())));
113  assertNotNull(response.getClaims().get(FRONT_CHANNEL_LOGOUT_URI.toString()));
114  assertTrue(new JSONArray(response.getClaims().get(FRONT_CHANNEL_LOGOUT_URI.toString())).getString(0).equals(logoutUri));
115  assertNotNull(response.getClaims().get(ID_TOKEN_SIGNED_RESPONSE_ALG.toString()));
116  assertEquals(SignatureAlgorithm.RS512,
117  SignatureAlgorithm.fromString(response.getClaims().get(ID_TOKEN_SIGNED_RESPONSE_ALG.toString())));
118  assertNotNull(response.getClaims().get(ID_TOKEN_ENCRYPTED_RESPONSE_ALG.toString()));
119  assertEquals(KeyEncryptionAlgorithm.RSA1_5,
120  KeyEncryptionAlgorithm.fromName(response.getClaims().get(ID_TOKEN_ENCRYPTED_RESPONSE_ALG.toString())));
121  assertNotNull(response.getClaims().get(ID_TOKEN_ENCRYPTED_RESPONSE_ENC.toString()));
122  assertEquals(BlockEncryptionAlgorithm.A128CBC_PLUS_HS256,
123  BlockEncryptionAlgorithm.fromName(response.getClaims().get(ID_TOKEN_ENCRYPTED_RESPONSE_ENC.toString())));
124  assertNotNull(response.getClaims().get(USERINFO_SIGNED_RESPONSE_ALG.toString()));
125  assertEquals(SignatureAlgorithm.RS384,
126  SignatureAlgorithm.fromString(response.getClaims().get(USERINFO_SIGNED_RESPONSE_ALG.toString())));
127  assertNotNull(response.getClaims().get(USERINFO_ENCRYPTED_RESPONSE_ALG.toString()));
128  assertEquals(KeyEncryptionAlgorithm.A128KW,
129  KeyEncryptionAlgorithm.fromName(response.getClaims().get(USERINFO_ENCRYPTED_RESPONSE_ALG.toString())));
130  assertNotNull(response.getClaims().get(USERINFO_ENCRYPTED_RESPONSE_ENC.toString()));
131  assertEquals(BlockEncryptionAlgorithm.A128GCM,
132  BlockEncryptionAlgorithm.fromName(response.getClaims().get(USERINFO_ENCRYPTED_RESPONSE_ENC.toString())));
133  assertNotNull(response.getClaims().get(REQUEST_OBJECT_SIGNING_ALG.toString()));
134  assertEquals(SignatureAlgorithm.RS256,
135  SignatureAlgorithm.fromString(response.getClaims().get(REQUEST_OBJECT_SIGNING_ALG.toString())));
136  assertNotNull(response.getClaims().get(REQUEST_OBJECT_ENCRYPTION_ALG.toString()));
137  assertEquals(KeyEncryptionAlgorithm.A256KW,
138  KeyEncryptionAlgorithm.fromName(response.getClaims().get(REQUEST_OBJECT_ENCRYPTION_ALG.toString())));
139  assertNotNull(response.getClaims().get(REQUEST_OBJECT_ENCRYPTION_ENC.toString()));
140  assertEquals(BlockEncryptionAlgorithm.A256CBC_PLUS_HS512,
141  BlockEncryptionAlgorithm.fromName(response.getClaims().get(REQUEST_OBJECT_ENCRYPTION_ENC.toString())));
142  assertNotNull(response.getClaims().get(TOKEN_ENDPOINT_AUTH_METHOD.toString()));
143  assertEquals(AuthenticationMethod.CLIENT_SECRET_JWT,
144  AuthenticationMethod.fromString(response.getClaims().get(TOKEN_ENDPOINT_AUTH_METHOD.toString())));
145  assertNotNull(response.getClaims().get(TOKEN_ENDPOINT_AUTH_SIGNING_ALG.toString()));
146  assertEquals(SignatureAlgorithm.ES256,
147  SignatureAlgorithm.fromString(response.getClaims().get(TOKEN_ENDPOINT_AUTH_SIGNING_ALG.toString())));
148  JSONArray scopesJsonArray = new JSONArray(StringUtils.spaceSeparatedToList(response.getClaims().get(SCOPE.toString())));
149  List<String> scopes = new ArrayList<String>();
150  for (int i = 0; i < scopesJsonArray.length(); i++) {
151  scopes.add(scopesJsonArray.get(i).toString());
152  }
153  assertTrue(scopes.contains("openid"));
154  assertTrue(scopes.contains("address"));
155  assertTrue(scopes.contains("email"));
156  assertTrue(scopes.contains("profile"));
157  assertTrue(scopes.contains("phone"));
158  assertTrue(scopes.contains("clientinfo"));
159 
160  registrationAccessToken1 = response.getRegistrationAccessToken();
161  registrationClientUri1 = response.getRegistrationClientUri();
162  }
String registrationEndpoint
Definition: BaseTest.java:81
static void showClient(BaseClient client)
Definition: BaseTest.java:775
String registrationAccessToken1
Definition: RegistrationRestWebServiceHttpTest.java:42
void showTitle(String title)
Definition: BaseTest.java:761
String registrationClientUri1
Definition: RegistrationRestWebServiceHttpTest.java:43
static ClientExecutor clientExecutor()
Definition: BaseTest.java:822

◆ requestClientAssociate3()

void org.xdi.oxauth.ws.rs.RegistrationRestWebServiceHttpTest.requestClientAssociate3 ( final String  redirectUris,
final String  sectorIdentifierUri,
final String  logoutUri 
) throws Exception
inline
238  {
239  showTitle("requestClientAssociate3");
240 
241  RegisterRequest registerRequest = new RegisterRequest(ApplicationType.WEB, "oxAuth test app",
242  StringUtils.spaceSeparatedToList(redirectUris));
243  registerRequest.setPostLogoutRedirectUris(Lists.newArrayList(logoutUri));
244  registerRequest.setSectorIdentifierUri(sectorIdentifierUri); //
245  registerRequest.setSubjectType(SubjectType.PAIRWISE);
246  registerRequest.setGrantTypes(Arrays.asList(GrantType.IMPLICIT));
247  registerRequest.setResponseTypes(Arrays.asList(ResponseType.TOKEN, ResponseType.ID_TOKEN));
248  registerRequest.setScope(Arrays.asList("openid", "profile", "email"));
249  registerRequest.setTokenEndpointAuthMethod(AuthenticationMethod.CLIENT_SECRET_POST);
250  registerRequest.setFrontChannelLogoutSessionRequired(true);
251  registerRequest.addCustomAttribute("oxAuthTrustedClient", "true");
252 
253  RegisterClient registerClient = new RegisterClient(registrationEndpoint);
254  registerClient.setRequest(registerRequest);
255  registerClient.setExecutor(clientExecutor(true));
256  RegisterResponse response = registerClient.exec();
257 
258  showClient(registerClient);
259  assertEquals(response.getStatus(), 200, "Unexpected response code: " + response.getEntity());
260  assertNotNull(response.getClientId());
261  assertNotNull(response.getClientSecret());
262  assertNotNull(response.getRegistrationAccessToken());
263  assertNotNull(response.getClientSecretExpiresAt());
264  assertNotNull(response.getClaims().get(SCOPE.toString()));
265  assertNotNull(response.getClaims().get(FRONT_CHANNEL_LOGOUT_SESSION_REQUIRED.toString()));
266  assertTrue(Boolean.parseBoolean(response.getClaims().get(FRONT_CHANNEL_LOGOUT_SESSION_REQUIRED.toString())));
267  assertNotNull(response.getClaims().get(ID_TOKEN_SIGNED_RESPONSE_ALG.toString()));
268  assertEquals(SignatureAlgorithm.RS256,
269  SignatureAlgorithm.fromString(response.getClaims().get(ID_TOKEN_SIGNED_RESPONSE_ALG.toString())));
270  assertEquals(AuthenticationMethod.CLIENT_SECRET_POST,
271  AuthenticationMethod.fromString(response.getClaims().get(TOKEN_ENDPOINT_AUTH_METHOD.toString())));
272  JSONArray scopesJsonArray = new JSONArray(StringUtils.spaceSeparatedToList(response.getClaims().get(SCOPE.toString())));
273  List<String> scopes = new ArrayList<String>();
274  for (int i = 0; i < scopesJsonArray.length(); i++) {
275  scopes.add(scopesJsonArray.get(i).toString());
276  }
277  assertTrue(scopes.contains("openid"));
278  assertTrue(scopes.contains("email"));
279  assertTrue(scopes.contains("profile"));
280 
281  registrationAccessToken2 = response.getRegistrationAccessToken();
282  registrationClientUri2 = response.getRegistrationClientUri();
283  }
String registrationEndpoint
Definition: BaseTest.java:81
static void showClient(BaseClient client)
Definition: BaseTest.java:775
String registrationClientUri2
Definition: RegistrationRestWebServiceHttpTest.java:45
String registrationAccessToken2
Definition: RegistrationRestWebServiceHttpTest.java:44
void showTitle(String title)
Definition: BaseTest.java:761
static ClientExecutor clientExecutor()
Definition: BaseTest.java:822

◆ requestClientRead()

void org.xdi.oxauth.ws.rs.RegistrationRestWebServiceHttpTest.requestClientRead ( ) throws Exception
inline
205  {
206  showTitle("requestClientRead");
207 
208  RegisterRequest registerRequest = new RegisterRequest(registrationAccessToken1);
209 
210  RegisterClient registerClient = new RegisterClient(registrationClientUri1);
211  registerClient.setRequest(registerRequest);
212  RegisterResponse response = registerClient.exec();
213 
214  showClient(registerClient);
215  assertEquals(response.getStatus(), 200, "Unexpected response code: " + response.getEntity());
216  assertNotNull(response.getClientId());
217  assertNotNull(response.getClientSecret());
218  assertNotNull(response.getRegistrationAccessToken());
219  assertNotNull(response.getRegistrationClientUri());
220  assertNotNull(response.getClientSecretExpiresAt());
221  assertNotNull(response.getClaims().get(APPLICATION_TYPE.toString()));
222  assertNotNull(response.getClaims().get(POLICY_URI.toString()));
223  assertNotNull(response.getClaims().get(REQUEST_OBJECT_SIGNING_ALG.toString()));
224  assertNotNull(response.getClaims().get(CONTACTS.toString()));
225  assertNotNull(response.getClaims().get(SECTOR_IDENTIFIER_URI.toString()));
226  assertNotNull(response.getClaims().get(SUBJECT_TYPE.toString()));
227  assertNotNull(response.getClaims().get(ID_TOKEN_SIGNED_RESPONSE_ALG.toString()));
228  assertNotNull(response.getClaims().get(JWKS_URI.toString()));
229  assertNotNull(response.getClaims().get(CLIENT_NAME.toString()));
230  assertNotNull(response.getClaims().get(LOGO_URI.toString()));
231  assertNotNull(response.getClaims().get(REQUEST_URIS.toString()));
232  assertNotNull(response.getClaims().get(SCOPE.toString()));
233  }
static void showClient(BaseClient client)
Definition: BaseTest.java:775
String registrationAccessToken1
Definition: RegistrationRestWebServiceHttpTest.java:42
void showTitle(String title)
Definition: BaseTest.java:761
String registrationClientUri1
Definition: RegistrationRestWebServiceHttpTest.java:43

◆ requestClientRegistrationFail1()

void org.xdi.oxauth.ws.rs.RegistrationRestWebServiceHttpTest.requestClientRegistrationFail1 ( ) throws Exception
inline
359  {
360  showTitle("requestClientRegistrationFail1");
361 
362  RegisterClient registerClient = new RegisterClient(registrationEndpoint);
363  RegisterResponse response = registerClient.execRegister(null, null, null);
364 
365  showClient(registerClient);
366  assertEquals(response.getStatus(), 400, "Unexpected response code: " + response.getEntity());
367  assertNotNull(response.getEntity(), "The entity is null");
368  assertNotNull(response.getErrorType(), "The error type is null");
369  assertNotNull(response.getErrorDescription(), "The error description is null");
370  }
String registrationEndpoint
Definition: BaseTest.java:81
static void showClient(BaseClient client)
Definition: BaseTest.java:775
void showTitle(String title)
Definition: BaseTest.java:761

◆ requestClientRegistrationFail2()

void org.xdi.oxauth.ws.rs.RegistrationRestWebServiceHttpTest.requestClientRegistrationFail2 ( ) throws Exception
inline
373  {
374  showTitle("requestClientRegistrationFail2");
375 
376  RegisterClient registerClient = new RegisterClient(registrationEndpoint);
377  RegisterResponse response = registerClient.execRegister(ApplicationType.WEB, "oxAuth test app", null); // Missing redirect URIs
378 
379  showClient(registerClient);
380  assertEquals(response.getStatus(), 400, "Unexpected response code: " + response.getEntity());
381  assertNotNull(response.getEntity(), "The entity is null");
382  assertNotNull(response.getErrorType(), "The error type is null");
383  assertNotNull(response.getErrorDescription(), "The error description is null");
384  }
String registrationEndpoint
Definition: BaseTest.java:81
static void showClient(BaseClient client)
Definition: BaseTest.java:775
void showTitle(String title)
Definition: BaseTest.java:761

◆ requestClientRegistrationFail3()

void org.xdi.oxauth.ws.rs.RegistrationRestWebServiceHttpTest.requestClientRegistrationFail3 ( ) throws Exception
inline
387  {
388  showTitle("requestClientRegistrationFail3");
389 
390  RegisterClient registerClient = new RegisterClient(registrationEndpoint);
391  RegisterResponse response = registerClient.execRegister(ApplicationType.WEB, "oxAuth test app",
392  Arrays.asList("https://client.example.com/cb#fail_fragment"));
393 
394  showClient(registerClient);
395  assertEquals(response.getStatus(), 400, "Unexpected response code: " + response.getEntity());
396  assertNotNull(response.getEntity(), "The entity is null");
397  assertNotNull(response.getErrorType(), "The error type is null");
398  assertNotNull(response.getErrorDescription(), "The error description is null");
399  }
String registrationEndpoint
Definition: BaseTest.java:81
static void showClient(BaseClient client)
Definition: BaseTest.java:775
void showTitle(String title)
Definition: BaseTest.java:761

◆ requestClientRegistrationFail4()

void org.xdi.oxauth.ws.rs.RegistrationRestWebServiceHttpTest.requestClientRegistrationFail4 ( final String  redirectUris) throws Exception
inline
403  {
404  showTitle("requestClientRegistrationFail4");
405 
406  RegisterRequest registerRequest = new RegisterRequest(ApplicationType.WEB, "oxAuth test app",
407  StringUtils.spaceSeparatedToList(redirectUris));
408  registerRequest.setIdTokenSignedResponseAlg(SignatureAlgorithm.NONE); // id_token signature cannot be none
409 
410  RegisterClient registerClient = new RegisterClient(registrationEndpoint);
411  registerClient.setRequest(registerRequest);
412  registerClient.setExecutor(clientExecutor(true));
413  RegisterResponse response = registerClient.exec();
414 
415  showClient(registerClient);
416  assertEquals(response.getStatus(), 400);
417  assertNotNull(response.getEntity());
418  assertNotNull(response.getErrorType());
419  assertNotNull(response.getErrorDescription());
420  }
String registrationEndpoint
Definition: BaseTest.java:81
static void showClient(BaseClient client)
Definition: BaseTest.java:775
void showTitle(String title)
Definition: BaseTest.java:761
static ClientExecutor clientExecutor()
Definition: BaseTest.java:822

◆ requestClientRegistrationWithCustomAttributes()

void org.xdi.oxauth.ws.rs.RegistrationRestWebServiceHttpTest.requestClientRegistrationWithCustomAttributes ( final String  redirectUris,
final String  sectorIdentifierUri 
) throws Exception
inline
335  {
336  showTitle("requestClientRegistrationWithCustomAttributes");
337 
338  final RegisterRequest request = new RegisterRequest(ApplicationType.WEB, "oxAuth test app",
339  StringUtils.spaceSeparatedToList(redirectUris));
340 
341  // custom attribute must be declared in oxauth-config.xml in dynamic-registration-custom-attribute tag
342  request.addCustomAttribute("myCustomAttr1", "customAttrValue1");
343  request.addCustomAttribute("myCustomAttr2", "customAttrValue2");
344  request.setSectorIdentifierUri(sectorIdentifierUri);
345 
346  final RegisterClient registerClient = new RegisterClient(registrationEndpoint);
347  registerClient.setRequest(request);
348  final RegisterResponse response = registerClient.exec();
349 
350  showClient(registerClient);
351  assertEquals(response.getStatus(), 200, "Unexpected response code: " + response.getEntity());
352  assertNotNull(response.getClientId());
353  assertNotNull(response.getClientSecret());
354  assertNotNull(response.getRegistrationAccessToken());
355  assertNotNull(response.getClientSecretExpiresAt());
356  }
String registrationEndpoint
Definition: BaseTest.java:81
static void showClient(BaseClient client)
Definition: BaseTest.java:775
void showTitle(String title)
Definition: BaseTest.java:761

◆ requestClientUpdate()

void org.xdi.oxauth.ws.rs.RegistrationRestWebServiceHttpTest.requestClientUpdate ( ) throws Exception
inline
165  {
166  showTitle("requestClientUpdate");
167 
168  final String logoUriNewValue = "http://www.gluu.org/test/yuriy/logo.png";
169  final String contact1NewValue = "yuriy@gluu.org";
170  final String contact2NewValue = "yuriyz@gmail.com";
171 
172  Calendar clientSecretExpiresAtCalendar = Calendar.getInstance();
173  clientSecretExpiresAtCalendar.add(Calendar.DAY_OF_YEAR, 1);
174  Date clientSecretExpiresAt = clientSecretExpiresAtCalendar.getTime();
175 
176  final RegisterRequest registerRequest = new RegisterRequest(registrationAccessToken1);
177  registerRequest.setHttpMethod(HttpMethod.PUT);
178  registerRequest.setContacts(Arrays.asList(contact1NewValue, contact2NewValue));
179  registerRequest.setLogoUri(logoUriNewValue);
180 
181  registerRequest.setClientSecretExpiresAt(clientSecretExpiresAt);
182 
183  final RegisterClient registerClient = new RegisterClient(registrationClientUri1);
184  registerClient.setRequest(registerRequest);
185  registerClient.setExecutor(clientExecutor(true));
186  final RegisterResponse response = registerClient.exec();
187 
188  showClient(registerClient);
189  assertEquals(response.getStatus(), 200, "Unexpected response code: " + response.getEntity());
190  assertNotNull(response.getClientId());
191 
192  // check whether info is really updated
193  final String responseContacts = response.getClaims().get(CONTACTS.toString());
194  final String responseLogoUri = response.getClaims().get(LOGO_URI.toString());
195 
196  assertTrue(responseContacts.contains(contact1NewValue) && responseContacts.contains(contact2NewValue));
197  assertNotNull(responseLogoUri.equals(logoUriNewValue));
198 
199  long diff = response.getClientSecretExpiresAt().getTime() / 10000 - clientSecretExpiresAt.getTime() / 10000; // check after division on 1000 because of internal server conversion
200  System.out.println("Diff: " + diff + ", respTime: " + response.getClientSecretExpiresAt().getTime() + ", expAt: " + clientSecretExpiresAt.getTime());
201  assertTrue(Math.abs(diff) == 0);
202  }
static void showClient(BaseClient client)
Definition: BaseTest.java:775
String registrationAccessToken1
Definition: RegistrationRestWebServiceHttpTest.java:42
void showTitle(String title)
Definition: BaseTest.java:761
String registrationClientUri1
Definition: RegistrationRestWebServiceHttpTest.java:43
static ClientExecutor clientExecutor()
Definition: BaseTest.java:822

◆ requestClientUpdate3()

void org.xdi.oxauth.ws.rs.RegistrationRestWebServiceHttpTest.requestClientUpdate3 ( ) throws Exception
inline
286  {
287  showTitle("requestClientUpdate3");
288 
289  final String clientName = "Dynamically Registered Client #1 update_1";
290 
291  final RegisterRequest registerRequest = new RegisterRequest(registrationAccessToken2);
292  registerRequest.setHttpMethod(HttpMethod.PUT);
293 
294  registerRequest.setRedirectUris(Arrays.asList("https://localhost:8443/auth"));
295  registerRequest.setPostLogoutRedirectUris(Arrays.asList("https://localhost:8443/auth"));
296  registerRequest.setApplicationType(ApplicationType.WEB);
297  registerRequest.setClientName(clientName);
298  registerRequest.setSubjectType(SubjectType.PUBLIC);
299  registerRequest.setGrantTypes(Arrays.asList(GrantType.IMPLICIT));
300  registerRequest.setResponseTypes(Arrays.asList(ResponseType.TOKEN, ResponseType.ID_TOKEN));
301  registerRequest.setScope(Arrays.asList("openid", "address", "profile", "email", "phone", "clientinfo", "invalid_scope"));
302  registerRequest.setTokenEndpointAuthMethod(AuthenticationMethod.CLIENT_SECRET_POST);
303  registerRequest.setFrontChannelLogoutSessionRequired(true);
304  registerRequest.addCustomAttribute("oxAuthTrustedClient", "true");
305 
306  final RegisterClient registerClient = new RegisterClient(registrationClientUri2);
307  registerClient.setRequest(registerRequest);
308  registerClient.setExecutor(clientExecutor(true));
309  final RegisterResponse response = registerClient.exec();
310 
311  showClient(registerClient);
312  assertEquals(response.getStatus(), 200, "Unexpected response code: " + response.getEntity());
313  assertNotNull(response.getClientId());
314 
315  assertTrue(response.getClaims().containsKey(CLIENT_NAME.toString()));
316  assertEquals(clientName, response.getClaims().get(CLIENT_NAME.toString()));
317  JSONArray scopesJsonArray = new JSONArray(StringUtils.spaceSeparatedToList(response.getClaims().get(SCOPE.toString())));
318  List<String> scopes = new ArrayList<String>();
319  for (int i = 0; i < scopesJsonArray.length(); i++) {
320  scopes.add(scopesJsonArray.get(i).toString());
321  }
322  assertTrue(scopes.contains("openid"));
323  assertTrue(scopes.contains("address"));
324  assertTrue(scopes.contains("email"));
325  assertTrue(scopes.contains("profile"));
326  assertTrue(scopes.contains("phone"));
327  assertTrue(scopes.contains("clientinfo"));
328  }
static void showClient(BaseClient client)
Definition: BaseTest.java:775
String registrationClientUri2
Definition: RegistrationRestWebServiceHttpTest.java:45
String registrationAccessToken2
Definition: RegistrationRestWebServiceHttpTest.java:44
void showTitle(String title)
Definition: BaseTest.java:761
static ClientExecutor clientExecutor()
Definition: BaseTest.java:822

◆ setAuthorizationEndpoint()

void org.xdi.oxauth.BaseTest.setAuthorizationEndpoint ( String  authorizationEndpoint)
inlineinherited
138  {
140  }
String authorizationEndpoint
Definition: BaseTest.java:72

◆ setCheckSessionIFrame()

void org.xdi.oxauth.BaseTest.setCheckSessionIFrame ( String  checkSessionIFrame)
inlineinherited
170  {
172  }
String checkSessionIFrame
Definition: BaseTest.java:78

◆ setClientInfoEndpoint()

void org.xdi.oxauth.BaseTest.setClientInfoEndpoint ( String  clientInfoEndpoint)
inlineinherited
162  {
164  }
String clientInfoEndpoint
Definition: BaseTest.java:77

◆ setConfigurationEndpoint()

void org.xdi.oxauth.BaseTest.setConfigurationEndpoint ( String  configurationEndpoint)
inlineinherited
226  {
228  }
String configurationEndpoint
Definition: BaseTest.java:82

◆ setDriver()

void org.xdi.oxauth.BaseTest.setDriver ( WebDriver  driver)
inlineinherited
130  {
131  this.driver = driver;
132  }
WebDriver driver
Definition: BaseTest.java:70

◆ setEndSessionEndpoint()

void org.xdi.oxauth.BaseTest.setEndSessionEndpoint ( String  endSessionEndpoint)
inlineinherited
178  {
180  }
String endSessionEndpoint
Definition: BaseTest.java:79

◆ setIdGenEndpoint()

void org.xdi.oxauth.BaseTest.setIdGenEndpoint ( String  p_idGenEndpoint)
inlineinherited
218  {
219  idGenEndpoint = p_idGenEndpoint;
220  }
String idGenEndpoint
Definition: BaseTest.java:83

◆ setIntrospectionEndpoint()

void org.xdi.oxauth.BaseTest.setIntrospectionEndpoint ( String  p_introspectionEndpoint)
inlineinherited
202  {
203  introspectionEndpoint = p_introspectionEndpoint;
204  }
String introspectionEndpoint
Definition: BaseTest.java:84

◆ setJwksUri()

void org.xdi.oxauth.BaseTest.setJwksUri ( String  jwksUri)
inlineinherited
186  {
187  this.jwksUri = jwksUri;
188  }
String jwksUri
Definition: BaseTest.java:80

◆ setRegistrationEndpoint()

void org.xdi.oxauth.BaseTest.setRegistrationEndpoint ( String  registrationEndpoint)
inlineinherited
194  {
196  }
String registrationEndpoint
Definition: BaseTest.java:81

◆ setScopeToClaimsMapping()

void org.xdi.oxauth.BaseTest.setScopeToClaimsMapping ( Map< String, List< String >>  p_scopeToClaimsMapping)
inlineinherited
210  {
211  scopeToClaimsMapping = p_scopeToClaimsMapping;
212  }
Map< String, List< String > > scopeToClaimsMapping
Definition: BaseTest.java:85

◆ setTokenEndpoint()

void org.xdi.oxauth.BaseTest.setTokenEndpoint ( String  tokenEndpoint)
inlineinherited
146  {
148  }
String tokenEndpoint
Definition: BaseTest.java:75

◆ setUserInfoEndpoint()

void org.xdi.oxauth.BaseTest.setUserInfoEndpoint ( String  userInfoEndpoint)
inlineinherited
154  {
156  }
String userInfoEndpoint
Definition: BaseTest.java:76

◆ showClient() [1/2]

static void org.xdi.oxauth.BaseTest.showClient ( BaseClient  client)
inlinestaticinherited
775  {
776  ClientUtils.showClient(client);
777  }
Definition: ClientUtils.java:17
static void showClient(BaseClient client)
Definition: ClientUtils.java:21

◆ showClient() [2/2]

static void org.xdi.oxauth.BaseTest.showClient ( BaseClient  client,
CookieStore  cookieStore 
)
inlinestaticinherited
779  {
780  ClientUtils.showClient(client, cookieStore);
781  }
Definition: ClientUtils.java:17
static void showClient(BaseClient client)
Definition: ClientUtils.java:21

◆ showClientUserAgent()

static void org.xdi.oxauth.BaseTest.showClientUserAgent ( BaseClient  client)
inlinestaticinherited
783  {
785  }
Definition: ClientUtils.java:17
static void showClientUserAgent(BaseClient client)
Definition: ClientUtils.java:35

◆ showEntity()

void org.xdi.oxauth.BaseTest.showEntity ( String  entity)
inlineinherited
769  {
770  if (entity != null) {
771  System.out.println("Entity: " + entity.replace("\\n", "\n"));
772  }
773  }

◆ showResponse() [1/2]

void org.xdi.oxauth.BaseTest.showResponse ( String  title,
Response  response 
)
inlineinherited
30  {
31  showResponse(title, response, null);
32  }
void showResponse(String title, Response response)
Definition: BaseTest.java:30

◆ showResponse() [2/2]

static void org.xdi.oxauth.BaseTest.showResponse ( String  title,
Response  response,
Object  entity 
)
inlinestaticinherited
34  {
35  System.out.println(" ");
36  System.out.println("RESPONSE FOR: " + title);
37  System.out.println(response.getStatus());
38  for (Entry<String, List<Object>> headers : response.getHeaders().entrySet()) {
39  String headerName = headers.getKey();
40  System.out.println(headerName + ": " + headers.getValue());
41  }
42 
43  if (entity != null) {
44  System.out.println(entity.toString().replace("\\n", "\n"));
45  }
46  System.out.println(" ");
47  System.out.println("Status message: " + response.getStatus());
48  }

◆ showTitle() [1/2]

void org.xdi.oxauth.BaseTest.showTitle ( String  title)
inlineinherited
22  {
23  title = "TEST: " + title;
24 
25  System.out.println("#######################################################");
26  System.out.println(title);
27  System.out.println("#######################################################");
28  }

◆ showTitle() [2/2]

void org.xdi.oxauth.BaseTest.showTitle ( String  title)
inlineinherited
761  {
762  title = "TEST: " + title;
763 
764  System.out.println("#######################################################");
765  System.out.println(title);
766  System.out.println("#######################################################");
767  }

◆ startSelenium()

void org.xdi.oxauth.BaseTest.startSelenium ( )
inlineinherited
230  {
231  //System.setProperty("webdriver.chrome.driver", "/Users/JAVIER/tmp/chromedriver");
232  //driver = new ChromeDriver();
233 
234  //driver = new SafariDriver();
235 
236  //driver = new FirefoxDriver();
237 
238  //driver = new InternetExplorerDriver();
239 
240  driver = new HtmlUnitDriver(true);
241  }
WebDriver driver
Definition: BaseTest.java:70

◆ stopSelenium()

void org.xdi.oxauth.BaseTest.stopSelenium ( )
inlineinherited
243  {
244 // driver.close();
245  driver.quit();
246  }
WebDriver driver
Definition: BaseTest.java:70

◆ waitForResourceOwnerAndGrantLoginForm() [1/2]

String org.xdi.oxauth.BaseTest.waitForResourceOwnerAndGrantLoginForm ( String  authorizeUrl,
AuthorizationRequest  authorizationRequest,
boolean  cleanupCookies 
)
inlineinherited

Try to open login form (via the user-agent)

617  {
618  String authorizationRequestUrl = authorizeUrl + "?" + authorizationRequest.getQueryString();
619 
620  AuthorizeClient authorizeClient = new AuthorizeClient(authorizeUrl);
621  authorizeClient.setRequest(authorizationRequest);
622 
623  System.out.println("waitForResourceOwnerAndGrantLoginForm: authorizationRequestUrl:" + authorizationRequestUrl);
624  startSelenium();
625  if (cleanupCookies) {
626  System.out.println("waitForResourceOwnerAndGrantLoginForm: Cleaning cookies");
628  }
629  driver.navigate().to(authorizationRequestUrl);
630 
631  WebElement usernameElement = driver.findElement(By.name(loginFormUsername));
632  WebElement passwordElement = driver.findElement(By.name(loginFormPassword));
633  WebElement loginButton = driver.findElement(By.name(loginFormLoginButton));
634 
635  if ((usernameElement == null) || (passwordElement == null) || (loginButton == null)) {
636  return null;
637  }
638 
639  Cookie sessionStateCookie = driver.manage().getCookieNamed("session_state");
640  String sessionState = null;
641  if (sessionStateCookie != null) {
642  sessionState = sessionStateCookie.getValue();
643  }
644  System.out.println("waitForResourceOwnerAndGrantLoginForm: sessionState:" + sessionState);
645 
646  stopSelenium();
647 
648  showClientUserAgent(authorizeClient);
649 
650  return sessionState;
651  }
String loginFormUsername
Definition: BaseTest.java:88
String loginFormPassword
Definition: BaseTest.java:89
void deleteAllCookies()
Definition: BaseTest.java:661
void stopSelenium()
Definition: BaseTest.java:243
Definition: AuthorizeClient.java:29
void startSelenium()
Definition: BaseTest.java:230
String loginFormLoginButton
Definition: BaseTest.java:90
void setRequest(T request)
Definition: BaseClient.java:68
WebDriver driver
Definition: BaseTest.java:70
String getQueryString()
Definition: AuthorizationRequest.java:486
static void showClientUserAgent(BaseClient client)
Definition: BaseTest.java:783

◆ waitForResourceOwnerAndGrantLoginForm() [2/2]

String org.xdi.oxauth.BaseTest.waitForResourceOwnerAndGrantLoginForm ( String  authorizeUrl,
AuthorizationRequest  authorizationRequest 
)
inlineinherited

Try to open login form (via the user-agent)

657  {
658  return waitForResourceOwnerAndGrantLoginForm(authorizeUrl, authorizationRequest, true);
659  }
String waitForResourceOwnerAndGrantLoginForm(String authorizeUrl, AuthorizationRequest authorizationRequest, boolean cleanupCookies)
Definition: BaseTest.java:616

メンバ詳解

◆ authorizationEndpoint

String org.xdi.oxauth.BaseTest.authorizationEndpoint
protectedinherited

◆ authorizationPageEndpoint

String org.xdi.oxauth.BaseTest.authorizationPageEndpoint
protectedinherited

◆ checkSessionIFrame

String org.xdi.oxauth.BaseTest.checkSessionIFrame
protectedinherited

◆ clientInfoEndpoint

String org.xdi.oxauth.BaseTest.clientInfoEndpoint
protectedinherited

◆ configurationEndpoint

String org.xdi.oxauth.BaseTest.configurationEndpoint
protectedinherited

◆ driver

WebDriver org.xdi.oxauth.BaseTest.driver
protectedinherited

◆ endSessionEndpoint

String org.xdi.oxauth.BaseTest.endSessionEndpoint
protectedinherited

◆ gluuConfigurationEndpoint

String org.xdi.oxauth.BaseTest.gluuConfigurationEndpoint
protectedinherited

◆ idGenEndpoint

String org.xdi.oxauth.BaseTest.idGenEndpoint
protectedinherited

◆ introspectionEndpoint

String org.xdi.oxauth.BaseTest.introspectionEndpoint
protectedinherited

◆ jwksUri

String org.xdi.oxauth.BaseTest.jwksUri
protectedinherited

◆ registrationAccessToken1

String org.xdi.oxauth.ws.rs.RegistrationRestWebServiceHttpTest.registrationAccessToken1
private

◆ registrationAccessToken2

String org.xdi.oxauth.ws.rs.RegistrationRestWebServiceHttpTest.registrationAccessToken2
private

◆ registrationClientUri1

String org.xdi.oxauth.ws.rs.RegistrationRestWebServiceHttpTest.registrationClientUri1
private

◆ registrationClientUri2

String org.xdi.oxauth.ws.rs.RegistrationRestWebServiceHttpTest.registrationClientUri2
private

◆ registrationEndpoint

String org.xdi.oxauth.BaseTest.registrationEndpoint
protectedinherited

◆ scopeToClaimsMapping

Map<String, List<String> > org.xdi.oxauth.BaseTest.scopeToClaimsMapping
protectedinherited

◆ testData

FileConfiguration org.xdi.oxauth.ConfigurableTest.testData
staticinherited

◆ tokenEndpoint

String org.xdi.oxauth.BaseTest.tokenEndpoint
protectedinherited

◆ userInfoEndpoint

String org.xdi.oxauth.BaseTest.userInfoEndpoint
protectedinherited

このクラス詳解は次のファイルから抽出されました: