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


Java OAuth1Parameters.setCallbackUrl方法代码示例

本文整理汇总了Java中org.springframework.social.oauth1.OAuth1Parameters.setCallbackUrl方法的典型用法代码示例。如果您正苦于以下问题:Java OAuth1Parameters.setCallbackUrl方法的具体用法?Java OAuth1Parameters.setCallbackUrl怎么用?Java OAuth1Parameters.setCallbackUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.social.oauth1.OAuth1Parameters的用法示例。


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

示例1: buildOAuth1Url

import org.springframework.social.oauth1.OAuth1Parameters; //导入方法依赖的package包/类
private String buildOAuth1Url(OAuth1ConnectionFactory<?> connectionFactory, NativeWebRequest request,
    MultiValueMap<String, String> additionalParameters) {
    OAuth1Operations oauthOperations = connectionFactory.getOAuthOperations();
    MultiValueMap<String, String> requestParameters = getRequestParameters(request);
    OAuth1Parameters parameters = getOAuth1Parameters(request, additionalParameters);
    parameters.putAll(requestParameters);
    if (oauthOperations.getVersion() == OAuth1Version.CORE_10) {
        parameters.setCallbackUrl(callbackUrl(request));
    }
    OAuthToken requestToken = fetchRequestToken(request, requestParameters, oauthOperations);
    sessionStrategy.setAttribute(request, OAUTH_TOKEN_ATTRIBUTE, requestToken);
    return buildOAuth1Url(oauthOperations, requestToken.getValue(), parameters);
}
 
开发者ID:xm-online,项目名称:xm-uaa,代码行数:14,代码来源:ConnectSupport.java

示例2: prepare

import org.springframework.social.oauth1.OAuth1Parameters; //导入方法依赖的package包/类
@Override
public CredentialFlowState prepare(final String connectorId, final URI baseUrl, final URI returnUrl) {
    final OAuth1CredentialFlowState.Builder flowState = new OAuth1CredentialFlowState.Builder().returnUrl(returnUrl)
        .providerId(id);

    final OAuth1Operations oauthOperations = connectionFactory.getOAuthOperations();
    final OAuth1Parameters parameters = new OAuth1Parameters();

    final String stateKey = UUID.randomUUID().toString();
    flowState.key(stateKey);

    final OAuthToken oAuthToken;
    final OAuth1Version oAuthVersion = oauthOperations.getVersion();

    if (oAuthVersion == OAuth1Version.CORE_10) {
        parameters.setCallbackUrl(callbackUrlFor(baseUrl, EMPTY));

        oAuthToken = oauthOperations.fetchRequestToken(null, null);
    } else if (oAuthVersion == OAuth1Version.CORE_10_REVISION_A) {
        oAuthToken = oauthOperations.fetchRequestToken(callbackUrlFor(baseUrl, EMPTY), null);
    } else {
        throw new IllegalStateException("Unsupported OAuth 1 version: " + oAuthVersion);
    }
    flowState.token(oAuthToken);

    final String redirectUrl = oauthOperations.buildAuthorizeUrl(oAuthToken.getValue(), parameters);
    flowState.redirectUrl(redirectUrl);

    flowState.connectorId(connectorId);

    return flowState.build();
}
 
开发者ID:syndesisio,项目名称:syndesis,代码行数:33,代码来源:OAuth1CredentialProvider.java

示例3: prepare

import org.springframework.social.oauth1.OAuth1Parameters; //导入方法依赖的package包/类
@Override
public CredentialFlowState prepare(final URI baseUrl, final URI returnUrl) {
    final OAuth1CredentialFlowState.Builder flowState = new OAuth1CredentialFlowState.Builder().returnUrl(returnUrl)
        .providerId(id);

    final OAuth1Operations oauthOperations = connectionFactory.getOAuthOperations();
    final OAuth1Parameters parameters = new OAuth1Parameters();

    final String stateKey = UUID.randomUUID().toString();
    flowState.key(stateKey);

    final OAuthToken oAuthToken;
    final OAuth1Version oAuthVersion = oauthOperations.getVersion();

    if (oAuthVersion == OAuth1Version.CORE_10) {
        parameters.setCallbackUrl(callbackUrlFor(baseUrl, EMPTY));

        oAuthToken = oauthOperations.fetchRequestToken(null, null);
    } else if (oAuthVersion == OAuth1Version.CORE_10_REVISION_A) {
        oAuthToken = oauthOperations.fetchRequestToken(callbackUrlFor(baseUrl, EMPTY), null);
    } else {
        throw new IllegalStateException("Unsupported OAuth 1 version: " + oAuthVersion);
    }
    flowState.token(oAuthToken);

    final String redirectUrl = oauthOperations.buildAuthorizeUrl(oAuthToken.getValue(), parameters);
    flowState.redirectUrl(redirectUrl);

    return flowState.build();
}
 
开发者ID:syndesisio,项目名称:syndesis-rest,代码行数:31,代码来源:OAuth1CredentialProvider.java

示例4: getOAuth1Parameters

import org.springframework.social.oauth1.OAuth1Parameters; //导入方法依赖的package包/类
@Override
protected OAuth1Parameters getOAuth1Parameters(String callbackUrl)
{
    OAuth1Parameters oAuth1Parameters = new OAuth1Parameters();
    oAuth1Parameters.setCallbackUrl(callbackUrl);
    oAuth1Parameters.set("perms", "delete");
    return oAuth1Parameters;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:9,代码来源:FlickrChannelType.java


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