use of org.forgerock.openam.services.baseurl.InvalidBaseUrlException in project OpenAM by OpenRock.
the class UmaUrisFactory method get.
/**
* <p>Gets the instance of the UmaUris.</p>
*
* <p>Cache each provider settings on the realm it was created for.</p>
*
* @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, ServerException {
String absoluteRealm = realmInfo.getAbsoluteRealm();
String baseUrl;
try {
baseUrl = baseURLProviderFactory.get(absoluteRealm).getRealmURL(request, "/uma", absoluteRealm);
} catch (InvalidBaseUrlException e) {
throw new ServerException("Configuration error");
}
UmaUris uris = urisMap.get(baseUrl);
if (uris == null) {
OAuth2Uris oAuth2Uris = oAuth2UriFactory.get(request, realmInfo);
uris = getUmaUris(absoluteRealm, oAuth2Uris, baseUrl);
}
return uris;
}
use of org.forgerock.openam.services.baseurl.InvalidBaseUrlException in project OpenAM by OpenRock.
the class OpenAMOAuth2UrisFactory method get.
/**
* Gets a OAuth2Uris instance.
*
* @param context TODO
* @param realmInfo The realm information.
* @return A UmaProviderSettings instance.
*/
@Override
public OAuth2Uris get(Context context, RealmInfo realmInfo) throws NotFoundException, ServerException {
String absoluteRealm = realmInfo.getAbsoluteRealm();
BaseURLProvider baseURLProvider = baseURLProviderFactory.get(absoluteRealm);
String baseUrl;
try {
baseUrl = baseURLProvider.getRealmURL(context.asContext(HttpContext.class), "/oauth2", absoluteRealm);
} catch (InvalidBaseUrlException e) {
throw new ServerException("Configuration error");
}
return get(absoluteRealm, baseUrl);
}
use of org.forgerock.openam.services.baseurl.InvalidBaseUrlException in project OpenAM by OpenRock.
the class UmaUrisFactory method get.
/**
* <p>Gets the instance of the UmaProviderSettings.</p>
*
* <p>Cache each provider settings on the realm it was created for.</p>
*
* @param context The context instance from which the base URL can be deduced.
* @param realmInfo The realm.
* @return The OAuth2ProviderSettings instance.
*/
public UmaUris get(Context context, RealmInfo realmInfo) throws NotFoundException, ServerException {
String absoluteRealm = realmInfo.getAbsoluteRealm();
HttpContext httpContext = context.asContext(HttpContext.class);
String baseUrl;
try {
baseUrl = baseURLProviderFactory.get(absoluteRealm).getRealmURL(httpContext, "/uma", absoluteRealm);
} catch (InvalidBaseUrlException e) {
throw new ServerException("Configuration error");
}
UmaUris uris = urisMap.get(baseUrl);
if (uris == null) {
OAuth2Uris oAuth2Uris = oAuth2UriFactory.get(context, realmInfo);
uris = get(absoluteRealm, oAuth2Uris, baseUrl);
}
return uris;
}
use of org.forgerock.openam.services.baseurl.InvalidBaseUrlException in project OpenAM by OpenRock.
the class OpenAMOAuth2UrisFactory method get.
@Override
public OAuth2Uris get(HttpServletRequest request, RealmInfo realmInfo) throws NotFoundException, ServerException {
String absoluteRealm = realmInfo.getAbsoluteRealm();
BaseURLProvider baseURLProvider = baseURLProviderFactory.get(absoluteRealm);
String baseUrl;
try {
baseUrl = baseURLProvider.getRealmURL(request, "/oauth2", absoluteRealm);
} catch (InvalidBaseUrlException e) {
throw new ServerException("Configuration error");
}
return get(absoluteRealm, baseUrl);
}
Aggregations