2012-06-13 52 views
0

我想扩展我的网站以支持OAuth,以便第三方应用程序可以代表网站用户访问数据并执行操作。我应该怎么做呢?在网站上实现OAuth支持

基本上我想知道如何去生成访问令牌和应该完成的数据库设置。

+0

你有什么平台在你的网站(语言+框架+持久性存储+ HTTP服务器)? –

+0

@ArtemOboturov:Java Spring,MySQL和GlassFish。 –

+0

在这种情况下,这似乎是重复[http://stackoverflow.com/questions/1731966/library-for-oauth-provider-java](http://stackoverflow.com/questions/1731966/library-for- OAuth的提供商的Java)。 –

回答

0

首先,您应该选择在您的网站上实施哪种授权模式。你的情况可能是:

  1. Authorization Code Grant
  2. Implicit Grant

然后以帐户一种编程语言和框架,你可以让你的选择。

在任何情况下,您都必须为OAuth网址和重定向以及持久性存储配置某种路由。

+0

OK。对于Spring来说,[http:/ https://github.com/SpringSource/spring-security-oauth/wiki/oauth2](https://github.com/SpringSource/spring-security-oauth/wiki/oauth2) /static.springsource.org/spring-security/oauth/](http://static.springsource.org/spring-security/oauth/)。 –