当前位置: 首页>>代码示例>>Java>>正文


Java ResponseTypeValues类代码示例

本文整理汇总了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);
}
 
开发者ID:approov,项目名称:AppAuth-OAuth2-Books-Demo,代码行数:25,代码来源:AuthRepo.java

示例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());
}
 
开发者ID:iainmcgin,项目名称:AppAuth-Demo,代码行数:25,代码来源:MainActivity.java

示例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();
}
 
开发者ID:Microsoft,项目名称:EmbeddedSocial-Android-SDK,代码行数:20,代码来源:GoogleNativeAuthenticator.java

示例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);
}
 
开发者ID:p7s1-ctf,项目名称:7pass-android-sample,代码行数:25,代码来源:LoginActivity.java

示例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());
}
 
开发者ID:openid,项目名称:AppAuth-Android,代码行数:16,代码来源:LoginActivity.java

示例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
            )
    );

}
 
开发者ID:janrain,项目名称:jump.android,代码行数:46,代码来源:OpenIDAppAuthGoogle.java


注:本文中的net.openid.appauth.ResponseTypeValues类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。