Search in sources :

Example 1 with GitHubProfileDefinition

use of org.pac4j.oauth.profile.github.GitHubProfileDefinition in project pac4j by pac4j.

the class GitHubClient method clientInit.

@Override
protected void clientInit() {
    configuration.setApi(GitHubApi.instance());
    configuration.setProfileDefinition(new GitHubProfileDefinition());
    defaultLogoutActionBuilder((ctx, profile, targetUrl) -> RedirectAction.redirect("https://github.com/logout"));
    super.clientInit();
}
Also used : GitHubProfileDefinition(org.pac4j.oauth.profile.github.GitHubProfileDefinition)

Example 2 with GitHubProfileDefinition

use of org.pac4j.oauth.profile.github.GitHubProfileDefinition in project pac4j by pac4j.

the class RunOAuth20Client method getClient.

@Override
protected IndirectClient getClient() {
    final var config = new OAuth20Configuration();
    config.setApi(GitHubApi.instance());
    config.setProfileDefinition(new GitHubProfileDefinition());
    config.setScope("user");
    config.setKey("62374f5573a89a8f9900");
    config.setSecret("01dd26d60447677ceb7399fb4c744f545bb86359");
    final var client = new OAuth20Client();
    client.setConfiguration(config);
    client.setCallbackUrl(PAC4J_BASE_URL);
    return client;
}
Also used : OAuth20Client(org.pac4j.oauth.client.OAuth20Client) OAuth20Configuration(org.pac4j.oauth.config.OAuth20Configuration) GitHubProfileDefinition(org.pac4j.oauth.profile.github.GitHubProfileDefinition)

Example 3 with GitHubProfileDefinition

use of org.pac4j.oauth.profile.github.GitHubProfileDefinition in project pac4j by pac4j.

the class GitHubClient method internalInit.

@Override
protected void internalInit(final boolean forceReinit) {
    configuration.setApi(GitHubApi.instance());
    configuration.setProfileDefinition(new GitHubProfileDefinition());
    configuration.setTokenAsHeader(true);
    defaultLogoutActionBuilder((ctx, session, profile, targetUrl) -> Optional.of(HttpActionHelper.buildRedirectUrlAction(ctx, "https://github.com/logout")));
    super.internalInit(forceReinit);
}
Also used : GitHubProfileDefinition(org.pac4j.oauth.profile.github.GitHubProfileDefinition)

Aggregations

GitHubProfileDefinition (org.pac4j.oauth.profile.github.GitHubProfileDefinition)3 OAuth20Client (org.pac4j.oauth.client.OAuth20Client)1 OAuth20Configuration (org.pac4j.oauth.config.OAuth20Configuration)1