Example #1
0
 /**
  * Gets the instance of the UmaUris.
  *
  * <p>Cache each provider settings on the realm it was created for.
  *
  * @param request The request instance from which the base URL can be deduced.
  * @param realmInfo The realm.
  * @return The OAuth2ProviderSettings instance.
  */
 public UmaUris get(HttpServletRequest request, RealmInfo realmInfo) throws NotFoundException {
   synchronized (providerSettingsMap) {
     UmaUris providerSettings = providerSettingsMap.get(realmInfo);
     if (providerSettings == null) {
       UmaProviderSettings umaProviderSettings =
           umaProviderSettingsFactory.get(realmInfo.getAbsoluteRealm());
       OAuth2Uris oAuth2Uris = oAuth2UriFactory.get(request, realmInfo);
       String baseUrlPattern =
           baseURLProviderFactory.get(realmInfo.getAbsoluteRealm()).getURL(request);
       providerSettings =
           getUmaProviderSettings(realmInfo, umaProviderSettings, oAuth2Uris, baseUrlPattern);
     }
     return providerSettings;
   }
 }
Example #2
0
 UmaUrisImpl(
     RealmInfo realmInfo,
     String deploymentUrl,
     UmaProviderSettings umaProviderSettings,
     OAuth2Uris oauth2Uris)
     throws NotFoundException {
   this.umaProviderSettings = umaProviderSettings;
   this.oauth2Uris = oauth2Uris;
   String baseUrl = deploymentUrl + "/uma" + realmInfo.getRealmSubPath();
   if (baseUrl.endsWith("/")) {
     baseUrl = baseUrl.substring(0, baseUrl.length() - 1);
   }
   this.baseUrl = baseUrl;
 }