本文整理汇总了Java中net.openid.appauth.ResponseTypeValues类的典型用法代码示例。如果您正苦于以下问题:Java ResponseTypeValues类的具体用法?Java ResponseTypeValues怎么用?Java ResponseTypeValues使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResponseTypeValues类属于net.openid.appauth包,在下文中一共展示了ResponseTypeValues类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startUserAuth
import net.openid.appauth.ResponseTypeValues; //导入依赖的package包/类
private void startUserAuth() {
Log.i(TAG, "Starting user auth");
loginListener.onEvent(AuthRepo.this, AUTH_USER_AUTH_START);
// may need to do this off UI thread?
AuthorizationRequest.Builder authRequestBuilder = new AuthorizationRequest.Builder(
authState.getAuthorizationServiceConfiguration(),
clientId,
ResponseTypeValues.CODE,
Uri.parse(redirectUri))
.setScope(authScope);
AuthorizationRequest authRequest = authRequestBuilder.build();
CustomTabsIntent.Builder intentBuilder =
authService.createCustomTabsIntentBuilder(authRequest.toUri());
intentBuilder.setToolbarColor(app.getColorValue(R.color.colorAccent));
CustomTabsIntent authIntent = intentBuilder.build();
Intent intent = authService.getAuthorizationRequestIntent(authRequest, authIntent);
loginListener.onUserAgentRequest(AuthRepo.this, intent);
}
示例2: makeAuthRequest
import net.openid.appauth.ResponseTypeValues; //导入依赖的package包/类
private void makeAuthRequest(
@NonNull AuthorizationServiceConfiguration serviceConfig,
@NonNull IdentityProvider idp) {
AuthorizationRequest authRequest = new AuthorizationRequest.Builder(
serviceConfig,
idp.getClientId(),
ResponseTypeValues.CODE,
idp.getRedirectUri())
.setScope(idp.getScope())
.build();
Log.d(TAG, "Making auth request to " + idp.name);
mAuthService.performAuthorizationRequest(
authRequest,
TokenActivity.createPostAuthorizationIntent(
this,
authRequest,
serviceConfig.discoveryDoc,
idp.getClientSecret()),
mAuthService.createCustomTabsIntentBuilder()
.setToolbarColor(getCustomTabColor())
.build());
}
示例3: sendAuthRequest
import net.openid.appauth.ResponseTypeValues; //导入依赖的package包/类
private void sendAuthRequest(AuthorizationServiceConfiguration serviceConfiguration) {
Options options = GlobalObjectRegistry.getObject(Options.class);
String clientId = options.getGoogleClientId();
String authRedirect = String.format("%s:/oauth2redirect", context.getPackageName());
Uri redirectUri = Uri.parse(authRedirect);
AuthorizationRequest request = new AuthorizationRequest.Builder(
serviceConfiguration,
clientId,
ResponseTypeValues.CODE,
redirectUri)
.setScopes(authMode.getPermissions())
.build();
PendingIntent pendingIntent = GoogleResponseHandler.createPostAuthorizationIntent(context, request);
service.performAuthorizationRequest(request, pendingIntent);
service.dispose();
}
示例4: initiateLogin
import net.openid.appauth.ResponseTypeValues; //导入依赖的package包/类
@WorkerThread
private void initiateLogin() {
AuthorizationRequest request = new AuthorizationRequest.Builder(
configuration.get(),
staticConfiguration.getClientId(),
ResponseTypeValues.CODE,
Uri.parse(staticConfiguration.getRedirectUri()))
.setScope(staticConfiguration.getScope())
.setPrompt(staticConfiguration.getPrompt())
.build();
Intent postLoginIntent = new Intent(this, PostLoginActivity.class);
Intent loginCancelledIntent = new Intent(this, LoginCancelledActivity.class);
loginCancelledIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
CustomTabsIntent customTabsIntent = service.createCustomTabsIntentBuilder(request.toUri()).build();
service.performAuthorizationRequest(
request,
PendingIntent.getActivity(this, 0, postLoginIntent, 0),
PendingIntent.getActivity(this, 1, loginCancelledIntent, 0),
customTabsIntent);
}
示例5: createAuthRequest
import net.openid.appauth.ResponseTypeValues; //导入依赖的package包/类
private void createAuthRequest(@Nullable String loginHint) {
Log.i(TAG, "Creating auth request for login hint: " + loginHint);
AuthorizationRequest.Builder authRequestBuilder = new AuthorizationRequest.Builder(
mAuthStateManager.getCurrent().getAuthorizationServiceConfiguration(),
mClientId.get(),
ResponseTypeValues.CODE,
mConfiguration.getRedirectUri())
.setScope(mConfiguration.getScope());
if (!TextUtils.isEmpty(loginHint)) {
authRequestBuilder.setLoginHint(loginHint);
}
mAuthRequest.set(authRequestBuilder.build());
}
示例6: makeAuthRequest
import net.openid.appauth.ResponseTypeValues; //导入依赖的package包/类
private void makeAuthRequest(
@NonNull AuthorizationServiceConfiguration serviceConfig,
@NonNull OpenIDIdentityProvider idp,
@NonNull AuthState authState) {
String clientId = idp.getClientId();
String code = ResponseTypeValues.CODE;
Uri redirectUri = idp.getRedirectUri();
AuthorizationRequest authRequest =
new AuthorizationRequest.Builder(serviceConfig, clientId, code, redirectUri)
.setScope(idp.getScope())
.setLoginHint(null)
.build();
//Intent postAuthIntent = new Intent(context, MyAuthResultHandlerActivity.class);
//Intent authCanceledIntent = new Intent(context, MyAuthCanceledHandlerActivity.class);
final JRSession session = JRSession.getInstance();
session.setCurrentlyAuthenticatingOpenIDAppAuthProvider(this);
// OpenIDAppAuthTokenActivity ta = new OpenIDAppAuthTokenActivity();
LogUtils.logd(TAG, "Making auth request to " + serviceConfig.authorizationEndpoint);
Context appContext = session.getCurrentOpenIDAppAuthActivity().getBaseContext();
Intent cancelIntent = new Intent(appContext, OpenIDAppAuthCancelledActivity.class);
cancelIntent.putExtra(EXTRA_FAILED, true);
cancelIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
mAuthService.performAuthorizationRequest(
authRequest,
OpenIDAppAuthTokenActivity.createPostAuthorizationIntent(
appContext,
authRequest,
serviceConfig.discoveryDoc,
authState
),
PendingIntent.getActivity(
appContext,
0,
cancelIntent,
PendingIntent.FLAG_UPDATE_CURRENT
)
);
}