in openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java [520:610]
public void loadInitialOAuthServers() {
// Yandex
oauthDao.update(new OAuthServer()
.setName("Yandex")
.setIconUrl("https://yandex.st/morda-logo/i/favicon.ico")
.setEnabled(false)
.setClientId(CLIENT_PLACEHOLDER)
.setClientSecret(SECRET_PLACEHOLDER)
.setRequestKeyUrl("https://oauth.yandex.ru/authorize?response_type=code&client_id={$client_id}")
.setRequestTokenUrl("https://oauth.yandex.ru/token")
.setRequestTokenMethod(RequestTokenMethod.POST)
.setRequestTokenAttributes("grant_type=authorization_code&code={$code}&client_id={$client_id}&client_secret={$client_secret}")
.setRequestInfoUrl("https://login.yandex.ru/info?format=json&oauth_token={$access_token}")
.addMapping(PARAM_LOGIN, "login")
.addMapping(PARAM_EMAIL, "default_email")
.addMapping(PARAM_FNAME, FNAME_PARAM)
.addMapping(PARAM_LNAME, LNAME_PARAM), null);
// Google
oauthDao.update(new OAuthServer()
.setName("Google")
.setIconUrl("https://www.google.com/images/google_favicon_128.png")
.setEnabled(false)
.setClientId(CLIENT_PLACEHOLDER)
.setClientSecret(SECRET_PLACEHOLDER)
.setRequestKeyUrl("https://accounts.google.com/o/oauth2/auth?redirect_uri={$redirect_uri}&response_type=code&client_id={$client_id}"
+ "&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile")
.setRequestTokenUrl("https://accounts.google.com/o/oauth2/token")
.setRequestTokenMethod(RequestTokenMethod.POST)
.setRequestTokenAttributes("code={$code}&client_id={$client_id}&client_secret={$client_secret}&redirect_uri={$redirect_uri}&grant_type=authorization_code")
.setRequestInfoUrl("https://www.googleapis.com/oauth2/v1/userinfo?access_token={$access_token}")
.setRequestInfoMethod(RequestInfoMethod.GET)
.addMapping(PARAM_LOGIN, EMAIL_PARAM)
.addMapping(PARAM_EMAIL, EMAIL_PARAM)
.addMapping(PARAM_FNAME, "given_name")
.addMapping(PARAM_LNAME, "family_name"), null);
// Facebook
oauthDao.update(new OAuthServer()
.setName("Facebook")
.setIconUrl("https://www.facebook.com/images/fb_icon_325x325.png")
.setEnabled(false)
.setClientId(CLIENT_PLACEHOLDER)
.setClientSecret(SECRET_PLACEHOLDER)
.setRequestKeyUrl("https://www.facebook.com/v4.0/dialog/oauth?client_id={$client_id}&redirect_uri={$redirect_uri}&scope=email")
.setRequestTokenUrl("https://graph.facebook.com/v4.0/oauth/access_token")
.setRequestTokenMethod(RequestTokenMethod.POST)
.setRequestTokenAttributes("client_id={$client_id}&redirect_uri={$redirect_uri}&client_secret={$client_secret}&code={$code}")
.setRequestInfoUrl("https://graph.facebook.com/me?access_token={$access_token}&fields=id,first_name,last_name,email")
.setRequestInfoMethod(RequestInfoMethod.GET)
.addMapping(PARAM_LOGIN, "id")
.addMapping(PARAM_EMAIL, EMAIL_PARAM)
.addMapping(PARAM_FNAME, FNAME_PARAM)
.addMapping(PARAM_LNAME, LNAME_PARAM), null);
// VK
oauthDao.update(new OAuthServer()
.setName("VK")
.setIconUrl("https://vk.com/images/icons/pwa/apple/default.png")
.setEnabled(false)
.setClientId(CLIENT_PLACEHOLDER)
.setClientSecret(SECRET_PLACEHOLDER)
.setRequestKeyUrl("https://oauth.vk.com/authorize?client_id={$client_id}&scope=email&redirect_uri={$redirect_uri}&response_type=code&v=5.68")
.setRequestTokenUrl("https://oauth.vk.com/access_token")
.setRequestTokenMethod(RequestTokenMethod.POST)
.setRequestTokenAttributes("client_id={$client_id}&client_secret={$client_secret}&code={$code}&redirect_uri={$redirect_uri}")
.setRequestInfoUrl("https://api.vk.com/method/users.get?&v=5.92&user_ids={$user_id}&access_token={$access_token}&fields=id,first_name,last_name,email&name_case=nom")
.setRequestInfoMethod(RequestInfoMethod.GET)
.addMapping(PARAM_LOGIN, "id")
.addMapping(PARAM_EMAIL, EMAIL_PARAM)
.addMapping(PARAM_FNAME, FNAME_PARAM)
.addMapping(PARAM_LNAME, LNAME_PARAM), null);
// keycloak
oauthDao.update(new OAuthServer()
.setName("keycloak")
.setIconUrl("https://www.keycloak.org/resources/images/keycloak_icon_512px.svg")
.setEnabled(false)
.setClientId(CLIENT_PLACEHOLDER)
.setClientSecret(SECRET_PLACEHOLDER)
.setRequestKeyUrl("<KeycloakBaseUrl>/auth/realms/uweslan/protocol/openid-connect/auth?redirect_uri={$redirect_uri}&client_id={$client_id}&response_type=code&scope=email")
.setRequestTokenUrl("<KeycloakBaseUrl>/auth/realms/<--custom-realm-->/protocol/openid-connect/token")
.setRequestTokenMethod(RequestTokenMethod.POST)
.setRequestTokenAttributes("code={$code}&client_id={$client_id}&client_secret={$client_secret}&redirect_uri={$redirect_uri}&grant_type=authorization_code")
.setRequestInfoUrl("<KeycloakBaseUrl>/auth/realms/<--custom-realm-->/protocol/openid-connect/userinfo")
.setRequestInfoMethod(RequestInfoMethod.HEADER)
.addMapping(PARAM_LOGIN, EMAIL_PARAM)
.addMapping(PARAM_EMAIL, EMAIL_PARAM)
.addMapping(PARAM_FNAME, "given_name")
.addMapping(PARAM_LNAME, "family_name"), null);
}