• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ResponseTypeValues类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MySqlUnique类代码示例发布时间:2022-05-22
下一篇:
Java MoreCollectors类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap