Added OAuth PKCE support

https://oauth.net/2/pkce/
This commit is contained in:
M66B
2020-07-16 18:50:36 +02:00
parent 5ee4955841
commit 8e78172c92
3 changed files with 7 additions and 0 deletions

View File

@@ -55,6 +55,7 @@ import net.openid.appauth.AuthorizationService;
import net.openid.appauth.AuthorizationServiceConfiguration;
import net.openid.appauth.ClientAuthentication;
import net.openid.appauth.ClientSecretPost;
import net.openid.appauth.CodeVerifierUtil;
import net.openid.appauth.NoClientAuthentication;
import net.openid.appauth.ResponseTypeValues;
import net.openid.appauth.TokenResponse;
@@ -282,6 +283,9 @@ public class FragmentOAuth extends FragmentBase {
if (askAccount)
authRequestBuilder.setLoginHint(etEmail.getText().toString().trim());
if (provider.oauth.pcke)
authRequestBuilder.setCodeVerifier(CodeVerifierUtil.generateRandomCodeVerifier());
// For offline access
if ("gmail".equals(provider.id))
authRequestBuilder.setPrompt("consent");