Added Gmail web OAuth flow

Thanks @cketti for pointing in the right direction!
This commit is contained in:
M66B
2022-07-16 13:07:38 +02:00
parent 86267a654f
commit c10abc0db0
8 changed files with 59 additions and 6 deletions

View File

@@ -403,12 +403,19 @@ public class FragmentOAuth extends FragmentBase {
? new LinkedHashMap<>()
: provider.oauth.parameters);
String clientId = provider.oauth.clientId;
Uri redirectUri = Uri.parse(provider.oauth.redirectUri);
if ("gmail".equals(id) && BuildConfig.DEBUG) {
clientId = "803253368361-hr8kelm53hqodj7c6brdjeb2ctn5jg3p.apps.googleusercontent.com";
redirectUri = Uri.parse("eu.faircode.email.debug:/");
}
AuthorizationRequest.Builder authRequestBuilder =
new AuthorizationRequest.Builder(
serviceConfig,
provider.oauth.clientId,
clientId,
ResponseTypeValues.CODE,
Uri.parse(provider.oauth.redirectUri))
redirectUri)
.setScopes(provider.oauth.scopes)
.setState(provider.id)
.setAdditionalParameters(params);