本文整理汇总了Java中org.springframework.social.oauth2.GrantType类的典型用法代码示例。如果您正苦于以下问题:Java GrantType类的具体用法?Java GrantType怎么用?Java GrantType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GrantType类属于org.springframework.social.oauth2包,在下文中一共展示了GrantType类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: connectWithGooglePlus
import org.springframework.social.oauth2.GrantType; //导入依赖的package包/类
@RequestMapping("/googleplus/connect")
public void connectWithGooglePlus(HttpServletResponse response, HttpSession session,
@RequestAttribute User loggedUser,
@RequestParam(required = false, defaultValue = "false") boolean sendInitialMessage)
throws IOException {
// if already connected, do nothing
if (loggedUser != null && loggedUser.getGooglePlusSettings() != null
&& loggedUser.getGooglePlusSettings().isFetchMessages()) {
return;
}
session.setAttribute(WebConstants.SEND_INITIAL_MESSAGE_KEY, sendInitialMessage);
String url = oAuthProvider.getOAuthOperations().buildAuthenticateUrl(GrantType.AUTHORIZATION_CODE,
oAuthParams);
response.sendRedirect(url);
}
开发者ID:Glamdring,项目名称:welshare,代码行数:18,代码来源:GooglePlusController.java
示例2: getAuthorisationUrls
import org.springframework.social.oauth2.GrantType; //导入依赖的package包/类
@Override
public AuthUrlPair getAuthorisationUrls(Channel channel, String callbackUrl)
{
ParameterCheck.mandatory("channel", channel);
if (!ID.equals(channel.getChannelType().getId()))
{
throw new IllegalArgumentException("Invalid channel type: " + channel.getChannelType().getId());
}
NodeRef channelRef = channel.getNodeRef();
StringBuilder authStateBuilder = new StringBuilder(channelRef.getStoreRef().getProtocol()).append('.').append(
channelRef.getStoreRef().getIdentifier()).append('.').append(channelRef.getId());
OAuth2Operations oauthOperations = publishingHelper.getConnectionFactory().getOAuthOperations();
OAuth2Parameters params = new OAuth2Parameters();
params.setRedirectUri(redirectUri);
params.setScope("publish_stream,offline_access,user_photos,user_videos");
params.setState(authStateBuilder.toString());
String authRequestUrl = oauthOperations.buildAuthorizeUrl(GrantType.IMPLICIT_GRANT, params);
return new AuthUrlPair(authRequestUrl, redirectUri);
}
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:21,代码来源:FacebookChannelType.java
示例3: getAuthenticateUrl
import org.springframework.social.oauth2.GrantType; //导入依赖的package包/类
public String getAuthenticateUrl(String state)
{
String authenticateUrl = null;
if (state != null)
{
/*
* When we change to spring social 1.0.2 OAuth2Parameters will need to be updated OAuth2Parameters parameters = new
* OAuth2Parameters(); parameters.setRedirectUri(REDIRECT_URI); parameters.setScope(SCOPE); parameters.setState(state);
*/
MultiValueMap<String, String> additionalParameters = new LinkedMultiValueMap<String, String>(1);
additionalParameters.add("access_type", "offline");
OAuth2Parameters parameters = new OAuth2Parameters(GoogleDocsConstants.REDIRECT_URI, GoogleDocsConstants.SCOPE, state, additionalParameters);
parameters.getAdditionalParameters();
authenticateUrl = connectionFactory.getOAuthOperations().buildAuthenticateUrl(GrantType.AUTHORIZATION_CODE, parameters);
}
log.debug("Authentication URL: " + authenticateUrl);
return authenticateUrl;
}
开发者ID:Pluies,项目名称:Alfresco-Google-docs-plugin,代码行数:25,代码来源:GoogleDocsServiceImpl.java
示例4: getAuthenticationURL
import org.springframework.social.oauth2.GrantType; //导入依赖的package包/类
/**
* API for getting the Authentication URL for Alfresco CMIS Server using Oauth.
*
* @param clientKey {@link String}
* @param secretKey {@link String}
* @param redirectURL {@link String}
* @return authenticationURL.
*/
public String getAuthenticationURL(String clientKey, String secretKey, String redirectURL) {
LOGGER.info("Inside get Authentication URL method");
AlfrescoConnectionFactory connectionFactory = new AlfrescoConnectionFactory(clientKey, secretKey);
OAuth2Parameters parameters = new OAuth2Parameters();
parameters.setRedirectUri(redirectURL);
parameters.setScope(Alfresco.DEFAULT_SCOPE);
return connectionFactory.getOAuthOperations().buildAuthenticateUrl(GrantType.AUTHORIZATION_CODE, parameters);
}
开发者ID:kuzavas,项目名称:ephesoft,代码行数:19,代码来源:AlfrescoCMISOAuth.java
示例5: buildAuthenticateUrl
import org.springframework.social.oauth2.GrantType; //导入依赖的package包/类
@Override
public String buildAuthenticateUrl(GrantType grantType, OAuth2Parameters parameters) {
if (redirectUri != null) parameters.setRedirectUri(redirectUri);
return super.buildAuthenticateUrl(grantType, parameters);
}
开发者ID:alex-bretet,项目名称:cloudstreetmarket.com,代码行数:6,代码来源:YahooOAuth2Template.java
示例6: buildAuthorizeUrl
import org.springframework.social.oauth2.GrantType; //导入依赖的package包/类
@Override
public String buildAuthorizeUrl(GrantType grantType, OAuth2Parameters parameters) {
if (redirectUri != null) parameters.setRedirectUri(redirectUri);
return super.buildAuthorizeUrl(grantType, parameters);
}
开发者ID:alex-bretet,项目名称:cloudstreetmarket.com,代码行数:6,代码来源:YahooOAuth2Template.java
注:本文中的org.springframework.social.oauth2.GrantType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论