Spring Social的核心API
package org.springframework.social.connect;
/**
* A link to a service provider user.
* Allows the client application to access or update user information using the provider's API.
* Exposes a set of operations that are common across all service providers, including
* the ability to {@link #fetchUserProfile() access user profile information} and {@link #updateStatus(String) update user status}.
* @author Keith Donald
* @param <A> a strongly-typed binding to the service provider's API
*/
public interface Connection<A> {
/**
* The key identifying this connection.
* A composite key that consists of the "providerId" plus "providerUserId"; for example, "facebook" and "125660".
*/
ConnectionKey getKey();
/**
* A display name or label for this connection.
* Should be suitable for display on a UI and distinguish this connection from others with the same provider.
* Generally the full name or screen name of the connected provider user e.g. "Keith Donald" or "@kdonald".
* May be null if this information is not public or not provided.
* The value of this property may change if the user updates his or her profile.
* @see #sync()
*/
String getDisplayName();
/**
* The public URL of the connected user's profile at the provider's site.
* A client application may use this value along with the displayName to generate a link to the user's profile on the provider's system.
* May be null if this information is not public or not provided.
* The value of this property may change if the user updates his or her profile.
* @see #sync()
*/
String getProfileUrl();
/**
* A link to a image that visualizes this connection.
* Should visually distinguish this connection from others with the same provider.
* Generally the small/thumbnail version of the connected provider user's profile picture.
* May be null if this information is not public or not provided.
* The value of this property may change if the user updates his or her profile.
* @see #sync()
*/
String getImageUrl();
/**
* Sync's this connection object with the current state of the external user's profile.
* Triggers locally cached profile fields to update if they have changed on the provider's system.
*/
void sync();
/**
* Test this connection.
* If false, indicates calls to the {@link #getApi() api} will fail.
* Used to proactively test authorization credentials such as an API access token before invoking the service API.
*/
boolean test();
/**
* Returns true if this connection has expired.
* An expired connection cannot be used; calls to {@link #test()} return false, and any service API invocations fail.
* If expired, you may call {@link #refresh()} to renew the connection.
* Not supported by all Connection implementations; always returns false if not supported.
*/
boolean hasExpired();
/**
* Refresh this connection.
* Used to renew an expired connection.
* If the refresh operation is successful, {@link #hasExpired()} returns false.
* Not supported by all connection implementations; if not supported, this method is a no-op.
*/
void refresh();
/**
* Fetch a normalized model of the user's profile on the provider system.
* Capable of exposing the user's name, email, and username.
* What is actually exposed depends on the provider and scope of this connection.
*/
UserProfile fetchUserProfile();
/**
* Update the user's status on the provider's system.
* This method is a no-op if a status concept is not supported by the service provider.
* @param message the status message
*/
void updateStatus(String message);
/**
* A Java binding to the service provider's native API.
*/
A getApi();
/**
* Creates a data transfer object that can be used to persist the state of this connection.
* Used to support the transfer of connection state between layers of the application, such as to the database layer.
*/
ConnectionData createData();
}
分享到:
相关推荐
本教程是全网最细致地讲解Spring Security、Spring Social 、Spring Security OAuth三种技术开发安全的REST服务,彻底掌握一线互联网公司主流的身份认证和授权方式。 Spring Security是一个能够为基于Spring的企业...
教程视频:spring提供的安全权限框架,Spring Security、Spring Social 、Spring Security OAuth
Spring社交扩展框架 Spring Social ,Spring Social 是 Spring 框架的扩展,用来方便开发Web社交应用程序,可通过该项...
剖析OAUTH 协议,探秘Spring Social 的功能,使用,下载和安装等等
主要介绍了利用Spring Social轻松搞定微信授权登录的方法示例,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
Github社交联合登录 步骤 1. 创建开发者应用 登录GitHub,【Settings】--> 【Developer settings】-->【OAuth Apps】-->【New Oauth App】,然后填写应用...spring.social.github.app-secret=YOUR_APP_SECRET
spring-social-core,详情官网http://www.springsource.org/spring-social
Spring Social Mockbin Spring Social Mockbin 基于构建,为提供 Java API 客户端。 Mockbin 由创建,“允许您生成自定义端点来测试、模拟和跟踪库、套接字和 API 之间的 HTTP 请求和响应”。 该项目遵循 Spring ...
Spring Social Ecobee 欢迎使用 Spring Social Ecobee,该库可让您与 Ecobee 的智能恒温器对话。参见上面的 CI 和与 gitter 聊天。 笔记Spring Social Ecobee 是一个社区项目,不受 Spring Social 团队的官方支持。 ...
spring-social-slideshare Spring Social 提供程序模块。项目状态目前只实现了SlideshowTemplate (幻灯片相关操作)。 如果您需要其他操作(用户、线索、活动等)或 Spring Social 的服务提供者连接框架的实现...
spring-social-google.zip,带有连接支持和google的api绑定的googleapipring社交扩展
7. Spring Social 8. Spring Security 9. Spring Mobile 10. Spring with other Web Frameworks 11. Data Access 12. Spring Transaction Management 13. Spring Batch 14. Spring NoSQL and Big Data 15. Spring ...
适用于Spring Boot的Spring Social Google Starter 通过该入门工具,您可以轻松集成Google的Spring Social扩展。 依存关系 该启动程序需要Spring Boot 1.3.0.M5和Java 8。
spring-social-kakao 连接 Kakao API(测试版)的 Spring Social 项目
这个项目是基于SpringBoot + SpringSecurity + SpringSocial + JWT方式的第三方登录和安全认证框架 包括APP +浏览器端的实现 学习的笔记和引导都在我的csdn博客更新中,有任何问题都可以问博主。 CSDN地址: :
Spring Security源码分析三:Spring Social 实现QQ社交登录 Spring Security源码分析四:Spring Social 实现微信社交登录 Spring Security源码分析五:Spring Security 实现短信登录 Spring Security源码分析六:...
安全用户身份验证 基于Spring Security,Spring Social和Spring Boot的安全用户身份验证Maven模块。
#Simple Spring 社交谷歌简单的 Spring Social Google 集成只是允许与 Google 帐户连接。 从 google oauth api v2 ( ) 检索用户个人资料信息,这意味着不需要 google plus 帐户即可连接。如何使用使用 ...
spring-boot-github-connector 这个例子展示了使用 spring boot 和 spring social github api 连接和阅读 Github 问题是多么容易
Spring Social BitBucket是Spring Social的扩展,用于启用与BitBucket API的连接。 参见 作者 埃里克·博塔德 执照 Spring Social BitBucket是在Apache 2许可下发布的。 有关许可证的副本,请参见LICENSE。 帮助 ...