use of org.forgerock.oauth2.core.OAuth2Uris 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);
}
use of org.forgerock.oauth2.core.OAuth2Uris in project OpenAM by OpenRock.
the class OpenAMResourceSetStoreTest method setup.
@BeforeMethod
@SuppressWarnings("unchecked")
public void setup() throws Exception {
dataStore = mock(TokenDataStore.class);
OAuth2ProviderSettingsFactory providerSettingsFactory = mock(OAuth2ProviderSettingsFactory.class);
OAuth2UrisFactory<RealmInfo> oAuth2UrisFactory = mock(OAuth2UrisFactory.class);
OAuth2Uris oAuth2Uris = mock(OAuth2Uris.class);
TokenIdGenerator idGenerator = mock(TokenIdGenerator.class);
store = new OpenAMResourceSetStore("REALM", providerSettingsFactory, oAuth2UrisFactory, idGenerator, dataStore);
given(oAuth2UrisFactory.get(Matchers.<OAuth2Request>anyObject())).willReturn(oAuth2Uris);
given(oAuth2Uris.getResourceSetRegistrationPolicyEndpoint(anyString())).willReturn("POLICY_URI");
}
Aggregations