oAuth를 사용하여 Salesforce에 Google 드라이브 통합을 만들 수있었습니다. 하지만 내 문제는 앱이 사용자를 Google에 로그인하도록 리디렉션한다는 것입니다. 프로그램 방식으로 로그인하여 모든 사용자가 별도의 단계없이 자동으로 동일한 Google 드라이브 사용자로 로그인되도록하고 싶습니다. 이 작업을 수행하는 유일한 방법은 Google 드라이브의 서비스 계정을 사용하는 것입니다. 문서를 보는 것 외에는 Apex에서 이것을 설정하는 방법을 알지 못합니다. 여기에 표시되는 문서는 자바 :Google 드라이브와 Salesforce의 통합 서비스 계정 사용
다음https://developers.google.com/identity/protocols/OAuth2ServiceAccount#authorizingrequests
OAuth를 작동 (그러나 구글에 로그인하도록 요구 내 인증의 URI입니다 : 다음
global class cAuthURIForApiReq {
global String authenticationURI = '';
public cAuthURIForApiReq(String clientKey, String redirect_uri) {
String key = EncodingUtil.urlEncode(clientKey, 'UTF-8');
String uri = EncodingUtil.urlEncode(redirect_uri, 'UTF-8');
String authuri = 'https://accounts.google.com/o/oauth2/v2/auth?' +
'client_id=' + key +
'&response_type=code' +
'&scope=https://www.googleapis.com/auth/drive' +
'&redirect_uri=' + uri +
'&state=security_token%3D138r5719ru3e1%26url%3Dhttps://oauth2-login-demo.example.com/myHome' +
'&[email protected]' +
'&access_type=offline';
authenticationURI = authuri;
}
}
과에가 이 방법을 호출하기 만하면됩니다.
public PageReference driveAuth() {
PageReference pg = new PageReference(new cAuthURIForApiReq(key, redirect_uri).authenticationURI);
return pg;
}
사람 로그인하도록 Google로 리디렉션되지 않고 프로그래밍 방식으로 인증하는 방법을 알고 계십니까?