use of org.pac4j.oauth.client.OAuth10Client in project cas by apereo.
the class DefaultDelegatedClientAuthenticationWebflowManagerTests method verifyOAuth1StoreOperation.
@Test
public void verifyOAuth1StoreOperation() throws Exception {
val config = new OAuth10Configuration();
config.setKey(UUID.randomUUID().toString());
config.setSecret(UUID.randomUUID().toString());
val client = new OAuth10Client();
client.setConfiguration(config);
val ticket = delegatedClientAuthenticationWebflowManager.store(context, client);
assertNotNull(ticketRegistry.getTicket(ticket.getId()));
val service = delegatedClientAuthenticationWebflowManager.retrieve(requestContext, context, client);
assertNotNull(service);
assertNull(ticketRegistry.getTicket(ticket.getId()));
}
use of org.pac4j.oauth.client.OAuth10Client in project pac4j by pac4j.
the class RunOAuth10Client method getClient.
@Override
protected IndirectClient getClient() {
final OAuth10Configuration config = new OAuth10Configuration();
config.setKey("bjEt8BMpLwFDqZUvp6");
config.setSecret("NN6fVXRTcV2qYVejVLZqxBRqHgn3ygD4");
config.setApi(new BitBucketApi());
config.setProfileDefinition(new BitbucketProfileDefinition());
final OAuth10Client client = new OAuth10Client();
client.setCallbackUrl(PAC4J_BASE_URL);
client.setConfiguration(config);
return client;
}
use of org.pac4j.oauth.client.OAuth10Client in project cas by apereo.
the class DefaultDelegatedClientAuthenticationWebflowManager method store.
@Override
public TransientSessionTicket store(final JEEContext webContext, final Client client) throws Exception {
val ticket = storeDelegatedClientAuthenticationRequest(webContext);
rememberSelectedClientIfNecessary(webContext, client);
if (client instanceof SAML2Client) {
trackSessionIdForSAML2Client(webContext, ticket, (SAML2Client) client);
}
if (client instanceof OAuth20Client) {
trackSessionIdForOAuth20Client(webContext, (OAuth20Client) client, ticket);
}
if (client instanceof OidcClient) {
trackSessionIdForOidcClient(webContext, (OidcClient) client, ticket);
}
if (client instanceof CasClient) {
trackSessionIdForCasClient(webContext, ticket, (CasClient) client);
}
if (client instanceof OAuth10Client) {
trackSessionIdForOAuth10Client(webContext, ticket);
}
return ticket;
}
Aggregations