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


Java OAuthConfig类代码示例

本文整理汇总了Java中org.scribe.model.OAuthConfig的典型用法代码示例。如果您正苦于以下问题:Java OAuthConfig类的具体用法?Java OAuthConfig怎么用?Java OAuthConfig使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OAuthConfig类属于org.scribe.model包,在下文中一共展示了OAuthConfig类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAuthorizationUrl

import org.scribe.model.OAuthConfig; //导入依赖的package包/类
@Override
public String getAuthorizationUrl(OAuthConfig config, String state) {

    // http://wiki.connect.qq.com/%E4%BD%BF%E7%94%A8authorization_code%E8%8E%B7%E5%8F%96access_token

    final String authorizationEndpoint = "https://graph.qq.com/oauth2.0/authorize";

    OAuthRequest request = new OAuthRequest(Verb.GET, authorizationEndpoint);
    request.addQuerystringParameter("response_type", "code");
    request.addQuerystringParameter(OAuthConstants.CLIENT_ID, config.getApiKey());
    request.addQuerystringParameter(OAuthConstants.CLIENT_SECRET, config.getApiSecret());
    request.addQuerystringParameter(OAuthConstants.REDIRECT_URI, config.getCallback());
    request.addQuerystringParameter("state", state);
    if (config.hasScope()) {
        request.addQuerystringParameter(OAuthConstants.SCOPE, config.getScope());
    }
    return request.getCompleteUrl();
}
 
开发者ID:btpka3,项目名称:pac4j-oauth-tencent,代码行数:19,代码来源:TencentApi.java

示例2: getAuthorizationUrl

import org.scribe.model.OAuthConfig; //导入依赖的package包/类
@Override
public String getAuthorizationUrl(OAuthConfig config) 
{
	Preconditions.checkValidUrl(config.getCallback(), "Must provide a valid url as callback.") ;
	if (config.hasScope()) 
	{
		return String.format(SCOPED_AUTHORIZE_URL, config.getApiKey(),
				OAuthEncoder.encode(config.getCallback()),
				OAuthEncoder.encode(config.getScope()));
	} 
	else 
	{
		return String.format(AUTHORIZE_URL, config.getApiKey(),
				OAuthEncoder.encode(config.getCallback()));
	}
}
 
开发者ID:roikku,项目名称:swift-explorer,代码行数:17,代码来源:HubicApi.java

示例3: getAuthorizationUrl

import org.scribe.model.OAuthConfig; //导入依赖的package包/类
@Override
public String getAuthorizationUrl( OAuthConfig config )
{
    // Append scope if present
    if ( config.hasScope() )
    {
        return String.format( SCOPED_AUTHORIZE_URL, config.getApiKey(),
                OAuthEncoder.encode( config.getCallback() ),
                OAuthEncoder.encode( config.getScope() ) );
    }
    else
    {
        return String.format( AUTHORIZE_URL, config.getApiKey(),
                OAuthEncoder.encode( config.getCallback() ) );
    }
}
 
开发者ID:iTwenty,项目名称:Hashtagger,代码行数:17,代码来源:Google2Api.java

示例4: getAuthorizationUrl

import org.scribe.model.OAuthConfig; //导入依赖的package包/类
@Override
public String getAuthorizationUrl( OAuthConfig config )
{
    if ( config.hasScope() )
    {
        return String.format( SCOPED_AUTHORIZATION_URL,
                config.getApiKey(),
                OAuthEncoder.encode( config.getCallback() ),
                OAuthEncoder.encode( config.getScope() ) );
    }
    else
    {
        return String.format( AUTHORIZATION_URL,
                config.getApiKey(),
                OAuthEncoder.encode( config.getCallback() ) );
    }
}
 
开发者ID:iTwenty,项目名称:Hashtagger,代码行数:18,代码来源:InstagramApi.java

示例5: getAuthorizationUrl

import org.scribe.model.OAuthConfig; //导入依赖的package包/类
@Override
public String getAuthorizationUrl(OAuthConfig config)
{
    Preconditions.checkValidUrl(config.getCallback(), "Must provide a valid url as callback for Instagram");
    String uuid = ServerUtils.makeRandomString();
    String aUrl = null;
    if (config.hasScope())
    {
        aUrl =  String.format(SCOPED_AUTHORIZATION_URL, config.getApiKey(), OAuthEncoder.encode(config.getCallback()),uuid,OAuthEncoder.encode(config.getScope()));
    }
    else
    {
        aUrl = String.format(AUTHORIZATION_URL, config.getApiKey(), OAuthEncoder.encode(config.getCallback()),uuid);
    }
    logger.info("Autorization URL: " + aUrl);
    return aUrl;
}
 
开发者ID:muquit,项目名称:gwtoauthlogindemo,代码行数:18,代码来源:Linkedin2Api.java

示例6: getAuthorizationUrl

import org.scribe.model.OAuthConfig; //导入依赖的package包/类
@Override
public final String getAuthorizationUrl(OAuthConfig config) {
	ParameterList paramList = new ParameterList();
	if (state!=null) {
		paramList.add("state", state);
	}
	paramList.add("response_type", getResponseType());
	paramList.add("client_id", config.getApiKey());
	if (StringUtils.isNotEmpty(config.getCallback()) && 
		!OAuthConstants.OUT_OF_BAND.equals(config.getCallback())) {
		paramList.add("redirect_uri", config.getCallback()); // for implicit grant
	}
	if (StringUtils.isNotEmpty(config.getScope())) {
		paramList.add("scope", config.getScope());
	}
	return paramList.appendTo(getAuthorizationUrlBase());
}
 
开发者ID:hburgmeier,项目名称:jerseyoauth2,代码行数:18,代码来源:BaseOAuth2Api.java

示例7: getAuthorizationUrl

import org.scribe.model.OAuthConfig; //导入依赖的package包/类
@Override
public String getAuthorizationUrl(OAuthConfig config) {
    // Append scope if present
    if (config.hasScope()) {
        return String.format(SCOPED_AUTHORIZE_URL, config.getApiKey(),
                OAuthEncoder.encode(config.getCallback()),
                OAuthEncoder.encode(config.getScope()));
    } else {
        return String.format(AUTHORIZE_URL, config.getApiKey(),
                OAuthEncoder.encode(config.getCallback()));
    }
}
 
开发者ID:elimu-ai,项目名称:webapp,代码行数:13,代码来源:Google2Api.java

示例8: getAuthorizationUrl

import org.scribe.model.OAuthConfig; //导入依赖的package包/类
@Override
public String getAuthorizationUrl(OAuthConfig config) {
    if (config.hasScope()) {
        return String.format(SCOPED_AUTHORIZE_URL, config.getApiKey(), OAuthEncoder.encode(config.getCallback()), githubState, OAuthEncoder.encode(config.getScope()));
    } else {
        return String.format(AUTHORIZE_URL, config.getApiKey(), OAuthEncoder.encode(config.getCallback()), githubState);
    }
}
 
开发者ID:bill1012,项目名称:AdminEAP,代码行数:9,代码来源:GithubApi.java

示例9: getAuthorizationUrl

import org.scribe.model.OAuthConfig; //导入依赖的package包/类
@Override
public String getAuthorizationUrl(final OAuthConfig config) {
    Preconditions.checkValidUrl(config.getCallback(),
            "Must provide a valid url as callback. Product Hunt does not support OOB");
    final StringBuilder sb = new StringBuilder(String.format(AUTHORIZE_URL, config.getApiKey(), OAuthEncoder.encode(
            config.getCallback())));
    if (config.hasScope()) {
        sb.append('&').append(OAuthConstants.SCOPE).append('=').append(OAuthEncoder.encode(config.getScope()));
    }

    return sb.toString();
}
 
开发者ID:hhua,项目名称:product-hunt-android,代码行数:13,代码来源:ProductHuntApi.java

示例10: createService

import org.scribe.model.OAuthConfig; //导入依赖的package包/类
@Override
public OAuthService createService(OAuthConfig config)
{
    if (isTwoLegged)
    {
        return new TwoLoOAuth10aServiceImpl(this, config);
    } else
    {
        return super.createService(config);
    }

}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:13,代码来源:OAuthBitbucket10aApi.java

示例11: HttpClientThrreeLoOAuth10aServiceImpl

import org.scribe.model.OAuthConfig; //导入依赖的package包/类
/**
 * Default constructor
 * 
 * @param api OAuth1.0a api information
 * @param config OAuth 1.0a configuration param object
 */
public HttpClientThrreeLoOAuth10aServiceImpl(DefaultApi10a api, OAuthConfig config, HttpClientProvider httpClientProvider)
{
  this.api = api;
  this.config = config;
  this.httpClientProvider = httpClientProvider;
}
 
开发者ID:edgehosting,项目名称:jira-dvcs-connector,代码行数:13,代码来源:HttpClientThrreeLoOAuth10aServiceImpl.java

示例12: getAuthorizationUrl

import org.scribe.model.OAuthConfig; //导入依赖的package包/类
@Override
public String getAuthorizationUrl(OAuthConfig config) {
	Preconditions.checkValidUrl(config.getCallback(), "Must provide a valid url as callback. LinkedIn does not support OOB");

	// Append scope if present
	if (config.hasScope()) {
		return String.format(SCOPED_AUTHORIZE_URL, config.getApiKey(), OAuthEncoder.encode(config.getCallback()), OAuthEncoder.encode(config.getScope()), generateState());
	} else {
		return String.format(AUTHORIZE_URL, config.getApiKey(), OAuthEncoder.encode(config.getCallback()), generateState());
	}
}
 
开发者ID:plekhotkindmytro,项目名称:Linkedin-oAuth2.0,代码行数:12,代码来源:LinkedInApi20.java

示例13: getAuthorizationUrl

import org.scribe.model.OAuthConfig; //导入依赖的package包/类
@Override
public String getAuthorizationUrl(OAuthConfig config) {
  return String.format(
      AUTHORIZE_URL,
      rootUrl,
      realm,
      config.getApiKey(),
      OAuthEncoder.encode(config.getCallback()),
      config.getScope().replaceAll(" ", "+"));
}
 
开发者ID:davido,项目名称:gerrit-oauth-provider,代码行数:11,代码来源:KeycloakApi.java

示例14: getAuthorizationUrl

import org.scribe.model.OAuthConfig; //导入依赖的package包/类
@Override
public String getAuthorizationUrl(OAuthConfig config) {
  Preconditions.checkValidUrl(
      config.getCallback(), "Must provide a valid url as callback. Google does not support OOB");
  Preconditions.checkEmptyString(
      config.getScope(), "Must provide a valid value as scope. Google does not support no scope");

  return String.format(
      AUTHORIZE_URL, config.getApiKey(), encode(config.getCallback()), encode(config.getScope()));
}
 
开发者ID:davido,项目名称:gerrit-oauth-provider,代码行数:11,代码来源:Google2Api.java

示例15: getAuthorizationUrl

import org.scribe.model.OAuthConfig; //导入依赖的package包/类
@Override
public String getAuthorizationUrl(OAuthConfig config) {
  return String.format(
      AUTHORIZE_URL,
      rootUrl,
      config.getApiKey(),
      OAuthEncoder.encode(config.getCallback()),
      config.getScope().replaceAll(" ", "+"));
}
 
开发者ID:davido,项目名称:gerrit-oauth-provider,代码行数:10,代码来源:DexApi.java


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