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();
}
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;
}
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);
}
Aggregations