- 浏览: 2490132 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
OAuth(1)Sample Consumer Implementation in JAVA
1. Some Concepts of the OAuth
Service Provider ------- Consumer ------ User
Consumer Key : the key for the consumer to the server provider
Consumer Secret: the password of the consumer key
Request Token: request
Access Token:
Token Secret:
The service provider need these parts:
a, 3 Service EndPoints:
get unauthorized request token;
get authorized request token;
get Access Token from authorized request token.
b, post form for loginning
c, manage the authorized things
The consumer need these parts:
a, get the customer key/customer secret
b, contact to the service provider via HTTP
2. Try the Sample Codes to learn this feature
download the java source code from here:
http://oauth.googlecode.com/svn/code/java/
Using maven to compile the old core part
>cd D:\book\oauth\java\oauth\core-old
>mvn install -DskipTests=true
>cd D:\book\oauth\java\oauth\core
>mvn install -DskipTests=true
Copy and import the service provider project D:\book\oauth\java\oauth\example\oauth-provider
The project name in eclipse is oauth-example-provider.
Copy and import the consumer provider project D:\book\oauth\java\oauth\example\webapp
The project name in eclipse is oauth-example-consumer.
Three URLs of the server side:
http://localhost:8080/oauth-provider/request_token
http://localhost:8080/oauth-provider/authorize
http://localhost:8080/oauth-provider/access_token
provider just use memory to store and get the key and password. It is very simple. we need to change them.
the consumer is also very simple.
3. Try another example consumer
open the git bash in the window console.
>cd /d/work
>git clone git://github.com/kaeppler/signpost.git
>cd signpost
>mvn install
take this java class as example
https://github.com/kaeppler/signpost-examples/blob/master/OAuthGoogleExample/src/GoogleMain.java
4. Modify the consumer base on a filter implementation from internet resources
The sample codes are in project easyoauthconsumer.
The most import part in consumer is this filter class OauthFilter.java:
package com.sillycat.easyoauthconsumer.web;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import net.oauth.OAuth;
import oauth.signpost.OAuthConsumer;
import oauth.signpost.OAuthProvider;
import oauth.signpost.exception.OAuthCommunicationException;
import oauth.signpost.exception.OAuthExpectationFailedException;
import oauth.signpost.exception.OAuthMessageSignerException;
import oauth.signpost.exception.OAuthNotAuthorizedException;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
public class OauthFilter implements Filter {
private String IS_USER_AUTHORISED = "is_user_authorised";
private String USER_INFO = "oauth_user_info";
private String FORBIDDEN_PAGE = "403.jsp";
private OAuthProvider provider;
private OAuthConsumer consumer;
private String protectedResourceUrl;
@Override
public void destroy() {
}
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
HttpServletRequest req = (HttpServletRequest) request;
ServletContext context = req.getSession().getServletContext();
String uri = req.getRequestURI();
if (uri.endsWith(FORBIDDEN_PAGE)) {
chain.doFilter(request, response);
return;
}
// check the request is authorized
HttpSession session = req.getSession();
Boolean isAuthorized = (Boolean) session
.getAttribute(IS_USER_AUTHORISED);
if (isAuthorized != null && Boolean.TRUE.equals(isAuthorized)) {
// only if the user is authorized
chain.doFilter(request, response);
return;
}
if (null == provider || null == consumer
|| null == protectedResourceUrl) {
// prepare the beans
WebApplicationContext ctx = WebApplicationContextUtils
.getRequiredWebApplicationContext(context);
provider = (OAuthProvider) ctx.getBean("provider");
consumer = (OAuthConsumer) ctx.getBean("consumer");
protectedResourceUrl = (String) ctx.getBean("protectedResourceUrl");
}
try {
String verifier = request.getParameter(OAuth.OAUTH_VERIFIER);
// oauth_verifier is not null, we get authorized from the server
if (verifier != null) {
// set to true if we use oauth 1.0
provider.setOAuth10a(true);
// get AccessToken
provider.retrieveAccessToken(consumer, verifier);
// visit the resources once we get access token
String result = getFromCAS(protectedResourceUrl);
session.setAttribute(IS_USER_AUTHORISED, true);
session.setAttribute(USER_INFO, result);
chain.doFilter(request, response);
return;
} else {
String returnUrl = req.getRequestURL().toString();
String url = provider.retrieveRequestToken(consumer, returnUrl);
((HttpServletResponse) response).sendRedirect(url);
}
} catch (OAuthMessageSignerException e) {
e.printStackTrace();
} catch (OAuthNotAuthorizedException e) {
e.printStackTrace();
} catch (OAuthExpectationFailedException e) {
e.printStackTrace();
} catch (OAuthCommunicationException e) {
e.printStackTrace();
}
}
@Override
public void init(FilterConfig filterConfig) throws ServletException {
}
private String getFromCAS(String urlString)
throws OAuthMessageSignerException,
OAuthExpectationFailedException, OAuthCommunicationException,
IOException {
URL url = new URL(urlString);
HttpURLConnection userRequest = (HttpURLConnection) url
.openConnection();
userRequest.setDoOutput(true);
consumer.sign(userRequest);
userRequest.connect();
BufferedReader in = new BufferedReader(new InputStreamReader(
userRequest.getInputStream()));
String inputLine;
StringBuffer result = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
System.out.println(inputLine);
result.append(" " + inputLine);
}
return result.toString();
}
}
The spring configuration file consumer-context.xml:
<bean id="provider" class="oauth.signpost.basic.DefaultOAuthProvider">
<constructor-arg index="0">
<!-- oauth requestToken -->
<value>http://localhost:8080/easyoauthprovider/request_token</value>
</constructor-arg>
<constructor-arg index="1">
<!-- oauth AcessToken-->
<value>http://localhost:8080/easyoauthprovider/access_token</value>
</constructor-arg>
<constructor-arg index="2">
<!-- oauth authorize-->
<value>http://localhost:8080/easyoauthprovider/authorize</value>
</constructor-arg>
</bean>
<!-- oauth resouce URLs-->
<bean id="protectedResourceUrl" class="java.lang.String" >
<constructor-arg>
<value>http://localhost:8080/easyoauthprovider/user</value>
</constructor-arg>
</bean>
<bean id="consumer" class="oauth.signpost.basic.DefaultOAuthConsumer">
<constructor-arg index="0">
<value>myKey</value>
</constructor-arg>
<constructor-arg index="1">
<value>mySecret</value>
</constructor-arg>
</bean>
Configure the filter and spring listener in web.xml:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:main-context.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<filter>
<filter-name>oauthFilter</filter-name>
<filter-class>com.sillycat.easyoauthconsumer.web.OauthFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>oauthFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
And all the jar packages are managed by ant ivy tool. ivy.xml:
<!-- commons -->
<dependency org="commons-logging" name="commons-logging" rev="1.1.1"/>
<dependency org="commons-httpclient" name="commons-httpclient" rev="3.0.1" />
<dependency org="commons-codec" name="commons-codec" rev="1.4" />
<!-- oauth jar -->
<dependency org="net/oauth" name="oauth" rev="20100601" />
<dependency org="net/oauth" name="oauth-provider" rev="20100601" />
<dependency org="net/oauth" name="oauth-consumer" rev="20100601" />
<dependency org="net/oauth" name="oauth-httpclient3" rev="20100601" />
<!-- log4j -->
<dependency org="log4j" name="log4j" rev="1.2.16" />
<!-- spring -->
<dependency org="org/springframework" name="spring-web" rev="3.0.5.RELEASE"/>
<dependency org="org/springframework" name="spring-context" rev="3.0.5.RELEASE"/>
<dependency org="org/springframework" name="spring-core" rev="3.0.5.RELEASE"/>
<dependency org="org/springframework" name="spring-beans" rev="3.0.5.RELEASE"/>
<dependency org="org/springframework" name="spring-asm" rev="3.0.5.RELEASE"/>
<dependency org="org/springframework" name="spring-expression" rev="3.0.5.RELEASE"/>
<!-- signpost -->
<dependency org="oauth/signpost" name="signpost-core" rev="1.2"/>
That is it. The sample consumer is ready.
refereces:
http://oauth.net/code/
http://dsbjoe.iteye.com/blog/1158233
http://www.ibm.com/developerworks/cn/java/j-lo-oauth/index.html
http://oauth.googlecode.com/svn/code/
https://github.com/kaeppler/signpost-examples
http://code.google.com/p/oauth-signpost/wiki/GettingStarted
https://github.com/kaeppler/signpost-examples/blob/master/OAuthGoogleExample/src/GoogleMain.java
http://spring-security-oauth.codehaus.org/tutorial.html
http://spring-security-oauth.codehaus.org/userguide.html
http://hueniverse.com/oauth/
http://hueniverse.com/oauth/guide/
http://hueniverse.com/2010/05/introducing-oauth-2-0/
1. Some Concepts of the OAuth
Service Provider ------- Consumer ------ User
Consumer Key : the key for the consumer to the server provider
Consumer Secret: the password of the consumer key
Request Token: request
Access Token:
Token Secret:
The service provider need these parts:
a, 3 Service EndPoints:
get unauthorized request token;
get authorized request token;
get Access Token from authorized request token.
b, post form for loginning
c, manage the authorized things
The consumer need these parts:
a, get the customer key/customer secret
b, contact to the service provider via HTTP
2. Try the Sample Codes to learn this feature
download the java source code from here:
http://oauth.googlecode.com/svn/code/java/
Using maven to compile the old core part
>cd D:\book\oauth\java\oauth\core-old
>mvn install -DskipTests=true
>cd D:\book\oauth\java\oauth\core
>mvn install -DskipTests=true
Copy and import the service provider project D:\book\oauth\java\oauth\example\oauth-provider
The project name in eclipse is oauth-example-provider.
Copy and import the consumer provider project D:\book\oauth\java\oauth\example\webapp
The project name in eclipse is oauth-example-consumer.
Three URLs of the server side:
http://localhost:8080/oauth-provider/request_token
http://localhost:8080/oauth-provider/authorize
http://localhost:8080/oauth-provider/access_token
provider just use memory to store and get the key and password. It is very simple. we need to change them.
the consumer is also very simple.
3. Try another example consumer
open the git bash in the window console.
>cd /d/work
>git clone git://github.com/kaeppler/signpost.git
>cd signpost
>mvn install
take this java class as example
https://github.com/kaeppler/signpost-examples/blob/master/OAuthGoogleExample/src/GoogleMain.java
4. Modify the consumer base on a filter implementation from internet resources
The sample codes are in project easyoauthconsumer.
The most import part in consumer is this filter class OauthFilter.java:
package com.sillycat.easyoauthconsumer.web;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import net.oauth.OAuth;
import oauth.signpost.OAuthConsumer;
import oauth.signpost.OAuthProvider;
import oauth.signpost.exception.OAuthCommunicationException;
import oauth.signpost.exception.OAuthExpectationFailedException;
import oauth.signpost.exception.OAuthMessageSignerException;
import oauth.signpost.exception.OAuthNotAuthorizedException;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
public class OauthFilter implements Filter {
private String IS_USER_AUTHORISED = "is_user_authorised";
private String USER_INFO = "oauth_user_info";
private String FORBIDDEN_PAGE = "403.jsp";
private OAuthProvider provider;
private OAuthConsumer consumer;
private String protectedResourceUrl;
@Override
public void destroy() {
}
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
HttpServletRequest req = (HttpServletRequest) request;
ServletContext context = req.getSession().getServletContext();
String uri = req.getRequestURI();
if (uri.endsWith(FORBIDDEN_PAGE)) {
chain.doFilter(request, response);
return;
}
// check the request is authorized
HttpSession session = req.getSession();
Boolean isAuthorized = (Boolean) session
.getAttribute(IS_USER_AUTHORISED);
if (isAuthorized != null && Boolean.TRUE.equals(isAuthorized)) {
// only if the user is authorized
chain.doFilter(request, response);
return;
}
if (null == provider || null == consumer
|| null == protectedResourceUrl) {
// prepare the beans
WebApplicationContext ctx = WebApplicationContextUtils
.getRequiredWebApplicationContext(context);
provider = (OAuthProvider) ctx.getBean("provider");
consumer = (OAuthConsumer) ctx.getBean("consumer");
protectedResourceUrl = (String) ctx.getBean("protectedResourceUrl");
}
try {
String verifier = request.getParameter(OAuth.OAUTH_VERIFIER);
// oauth_verifier is not null, we get authorized from the server
if (verifier != null) {
// set to true if we use oauth 1.0
provider.setOAuth10a(true);
// get AccessToken
provider.retrieveAccessToken(consumer, verifier);
// visit the resources once we get access token
String result = getFromCAS(protectedResourceUrl);
session.setAttribute(IS_USER_AUTHORISED, true);
session.setAttribute(USER_INFO, result);
chain.doFilter(request, response);
return;
} else {
String returnUrl = req.getRequestURL().toString();
String url = provider.retrieveRequestToken(consumer, returnUrl);
((HttpServletResponse) response).sendRedirect(url);
}
} catch (OAuthMessageSignerException e) {
e.printStackTrace();
} catch (OAuthNotAuthorizedException e) {
e.printStackTrace();
} catch (OAuthExpectationFailedException e) {
e.printStackTrace();
} catch (OAuthCommunicationException e) {
e.printStackTrace();
}
}
@Override
public void init(FilterConfig filterConfig) throws ServletException {
}
private String getFromCAS(String urlString)
throws OAuthMessageSignerException,
OAuthExpectationFailedException, OAuthCommunicationException,
IOException {
URL url = new URL(urlString);
HttpURLConnection userRequest = (HttpURLConnection) url
.openConnection();
userRequest.setDoOutput(true);
consumer.sign(userRequest);
userRequest.connect();
BufferedReader in = new BufferedReader(new InputStreamReader(
userRequest.getInputStream()));
String inputLine;
StringBuffer result = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
System.out.println(inputLine);
result.append(" " + inputLine);
}
return result.toString();
}
}
The spring configuration file consumer-context.xml:
<bean id="provider" class="oauth.signpost.basic.DefaultOAuthProvider">
<constructor-arg index="0">
<!-- oauth requestToken -->
<value>http://localhost:8080/easyoauthprovider/request_token</value>
</constructor-arg>
<constructor-arg index="1">
<!-- oauth AcessToken-->
<value>http://localhost:8080/easyoauthprovider/access_token</value>
</constructor-arg>
<constructor-arg index="2">
<!-- oauth authorize-->
<value>http://localhost:8080/easyoauthprovider/authorize</value>
</constructor-arg>
</bean>
<!-- oauth resouce URLs-->
<bean id="protectedResourceUrl" class="java.lang.String" >
<constructor-arg>
<value>http://localhost:8080/easyoauthprovider/user</value>
</constructor-arg>
</bean>
<bean id="consumer" class="oauth.signpost.basic.DefaultOAuthConsumer">
<constructor-arg index="0">
<value>myKey</value>
</constructor-arg>
<constructor-arg index="1">
<value>mySecret</value>
</constructor-arg>
</bean>
Configure the filter and spring listener in web.xml:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:main-context.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<filter>
<filter-name>oauthFilter</filter-name>
<filter-class>com.sillycat.easyoauthconsumer.web.OauthFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>oauthFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
And all the jar packages are managed by ant ivy tool. ivy.xml:
<!-- commons -->
<dependency org="commons-logging" name="commons-logging" rev="1.1.1"/>
<dependency org="commons-httpclient" name="commons-httpclient" rev="3.0.1" />
<dependency org="commons-codec" name="commons-codec" rev="1.4" />
<!-- oauth jar -->
<dependency org="net/oauth" name="oauth" rev="20100601" />
<dependency org="net/oauth" name="oauth-provider" rev="20100601" />
<dependency org="net/oauth" name="oauth-consumer" rev="20100601" />
<dependency org="net/oauth" name="oauth-httpclient3" rev="20100601" />
<!-- log4j -->
<dependency org="log4j" name="log4j" rev="1.2.16" />
<!-- spring -->
<dependency org="org/springframework" name="spring-web" rev="3.0.5.RELEASE"/>
<dependency org="org/springframework" name="spring-context" rev="3.0.5.RELEASE"/>
<dependency org="org/springframework" name="spring-core" rev="3.0.5.RELEASE"/>
<dependency org="org/springframework" name="spring-beans" rev="3.0.5.RELEASE"/>
<dependency org="org/springframework" name="spring-asm" rev="3.0.5.RELEASE"/>
<dependency org="org/springframework" name="spring-expression" rev="3.0.5.RELEASE"/>
<!-- signpost -->
<dependency org="oauth/signpost" name="signpost-core" rev="1.2"/>
That is it. The sample consumer is ready.
refereces:
http://oauth.net/code/
http://dsbjoe.iteye.com/blog/1158233
http://www.ibm.com/developerworks/cn/java/j-lo-oauth/index.html
http://oauth.googlecode.com/svn/code/
https://github.com/kaeppler/signpost-examples
http://code.google.com/p/oauth-signpost/wiki/GettingStarted
https://github.com/kaeppler/signpost-examples/blob/master/OAuthGoogleExample/src/GoogleMain.java
http://spring-security-oauth.codehaus.org/tutorial.html
http://spring-security-oauth.codehaus.org/userguide.html
http://hueniverse.com/oauth/
http://hueniverse.com/oauth/guide/
http://hueniverse.com/2010/05/introducing-oauth-2-0/
发表评论
-
Stop Update Here
2020-04-28 09:00 267I will stop update here, and mo ... -
NodeJS12 and Zlib
2020-04-01 07:44 433NodeJS12 and Zlib It works as ... -
Docker Swarm 2020(2)Docker Swarm and Portainer
2020-03-31 23:18 316Docker Swarm 2020(2)Docker Swar ... -
Docker Swarm 2020(1)Simply Install and Use Swarm
2020-03-31 07:58 325Docker Swarm 2020(1)Simply Inst ... -
Traefik 2020(1)Introduction and Installation
2020-03-29 13:52 297Traefik 2020(1)Introduction and ... -
Portainer 2020(4)Deploy Nginx and Others
2020-03-20 12:06 383Portainer 2020(4)Deploy Nginx a ... -
Private Registry 2020(1)No auth in registry Nginx AUTH for UI
2020-03-18 00:56 379Private Registry 2020(1)No auth ... -
Docker Compose 2020(1)Installation and Basic
2020-03-15 08:10 331Docker Compose 2020(1)Installat ... -
VPN Server 2020(2)Docker on CentOS in Ubuntu
2020-03-02 08:04 403VPN Server 2020(2)Docker on Cen ... -
Buffer in NodeJS 12 and NodeJS 8
2020-02-25 06:43 339Buffer in NodeJS 12 and NodeJS ... -
NodeJS ENV Similar to JENV and PyENV
2020-02-25 05:14 420NodeJS ENV Similar to JENV and ... -
Prometheus HA 2020(3)AlertManager Cluster
2020-02-24 01:47 365Prometheus HA 2020(3)AlertManag ... -
Serverless with NodeJS and TencentCloud 2020(5)CRON and Settings
2020-02-24 01:46 294Serverless with NodeJS and Tenc ... -
GraphQL 2019(3)Connect to MySQL
2020-02-24 01:48 214GraphQL 2019(3)Connect to MySQL ... -
GraphQL 2019(2)GraphQL and Deploy to Tencent Cloud
2020-02-24 01:48 395GraphQL 2019(2)GraphQL and Depl ... -
GraphQL 2019(1)Apollo Basic
2020-02-19 01:36 280GraphQL 2019(1)Apollo Basic Cl ... -
Serverless with NodeJS and TencentCloud 2020(4)Multiple Handlers and Running wit
2020-02-19 01:19 268Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(3)Build Tree and Traverse Tree
2020-02-19 01:19 268Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(2)Trigger SCF in SCF
2020-02-19 01:18 255Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(1)Running with Component
2020-02-19 01:17 240Serverless with NodeJS and Tenc ...
相关推荐
python库。 资源全名:oauth2sample-0.1.tar.gz
资源为在eclipse开发环境中使用Java搭建OAuth Server和OAuth Client 参考代码为http://code.google.com/p/oauth/ OAuth Server为遵守OAuth 1.0协议的OAuth认证服务器 OAuth Client分为Desktop版本和Webapp版本
Java的oauth2.0 服务端与客户端的实现.zip 封装了oauth2.0的基本架构和实现,对照我的博客http://blog.csdn.net/jing12062011/article/details/78147306使用该源码。 下载项目压缩包,解压,里面两个maven项目:...
还在烦恼OAuth2技术只依赖boot吗?我提供了纯java技术实现OAuth2的全部实现,含客户端和服务端的完整解决方案。
oauth本身不是技术,而是一项资源授权协议,重点是协议!Apache基金会提供了针对Java的oauth封装。我们做Java web项目想要实现oauth协议进行资源授权访问,直接使用该封装就可以。
Oauth实例(使用Scribe-java实现新浪微博的Oauth)
自定义OAuth服务端(WCF REST数据访问控制) 详见:http://blog.csdn.net/fangxinggood/article/details/6647672
Java的oauth2.0 服务端与客户端的实现源码下载,里面两个maven项目:oauthserver和oauthclient01。
微博Oauth2.0 协议,用java 实现单点登录获取用户信息。
OAuth 2.0 in Action OAuth 2.0 in Action OAuth 2.0 in Action OAuth 2.0 in Action OAuth 2.0 in Action
基于MAVEN+OLTU开源代码实现javaOauth2.0前后端,数据加密使用MD5。
We want you to come away from this book with a deep understanding of what OAuth can do, why it works the way that it does, and how to deploy it properly and securely in an unsafe internet. ...
1、公众号 扫描测试号二维码关注 2、ngrok 创建本机域名 3、网页服务--》网页帐号--》修改--》授权回调页面域名: 882c783d.ngrok.io 该域名为ngrok域名 4、修改程序中 appID值 org.liufeng.course.servlet....
最近开放平台非常火,各大互联网公司都纷纷推出各自的开放平台,随之流行的 OpenID, OAuth 则成为认证和授权的主要技术。本文将以登陆新浪微博获得授权取得用户数据作为示例简单研究 OAuth 的使用
Oauth2 Java demo
小米oauth2.0java实现以及第三方云接入,实现了多种参数的接口9state.response_type,client_id,client_secret等)
模拟OAuth2 单点登录的java代码实现。模拟OAuth2 单点登录的java代码实现。模拟OAuth2 单点登录的java代码实现。模拟OAuth2 单点登录的java代码实现。
基于java的开发源码-OAuth 实现框架 Agorava.zip 基于java的开发源码-OAuth 实现框架 Agorava.zip v基于java的开发源码-OAuth 实现框架 Agorava.zip 基于java的开发源码-OAuth 实现框架 Agorava.zip 基于java的开发...
微信基于Oauth2获取用户基本信息,保证可用。
oauth1-signer-java 目录 签署HTTP客户端请求对象 与OpenAPI Generator API客户端库集成 概述 零依赖性库,用于生成符合Mastercard API的OAuth签名。 兼容性 Java 7+ 参考 OAuth 1.0a规范 非应用程序/ x-...