The Admin Settings API is deprecated and is scheduled to be sunset on August 16, 2017. I have used this API's in our application to enable/disable Single Sign On. Is there any alternative to the Google Apps Admin Settings API.
I have referred below link.
https://developers.google.com/admin-sdk/admin-settings/
Here is the code I'm using to enable Single Sign On (SSO).
try{
Collection<String> SCOPES = new ArrayList<String>();
SCOPES.add("https://apps-apis.google.com/a/feeds/domain/");
HttpTransport httpTransport = new NetHttpTransport();
JacksonFactory jsonFactory = new JacksonFactory();
GoogleCredential credential = new GoogleCredential.Builder()
.setTransport(httpTransport)
.setJsonFactory(jsonFactory)
.setServiceAccountId(SERVICE_ACCOUNT_EMAIL)
.setServiceAccountScopes(SCOPES)
.setServiceAccountUser(ADMIN_EMAIL)
.setServiceAccountPrivateKeyFromP12File(
new java.io.File(SERVICE_ACCOUNT_PKCS12_FILE_PATH))
.build();
//Sets the Single Sign On settings and Uploads the public key.
SingleSignOnService ssoservice = new SingleSignOnService(DOMAIN_NAME,APPLICATION_NAME);
ssoservice.setOAuth2Credentials(credential);
final String key = SECRET_KEY;
GenericEntry update = new GenericEntry();
update.addProperty("samlSignonUri",SAML_SIGNON_URL);
update.addProperty("samlLogoutUri", SAML_LOGOUT_URL);
update.addProperty("changePasswordUri",CHANGE_PASSWORD_URL);
update.addProperty("enableSSO", "true");
update.addProperty("ssoWhitelist", "");
update.addProperty("useDomainSpecificIssuer", "false");
ssoservice.updateSSOSettings(update);
ssoservice.updateSsoSigningKey(key);
response.sendRedirect(callBackUrl);
}
catch(Exception e)
{
ErrorHandler.errorHandler(this.getClass().getSimpleName(),e);
}
Please help me out.