appstep项目说明(针对java开发的项目)
一、 appstep/src/com/siant/filter/OAuthFilter.java可直接复制到应用系统,并在web.xml中加入如下配置
<filter>
<filter-name>OAuthFilter</filter-name>
<filter-class>
com.siant.filter.OAuthFilter
</filter-class>
<init-param>
<param-name>SPConfig</param-name>
<param-value>/WEB-INF/config/OauthConfig.xml</param-value>
</init-param>
<!-- 是否使用过滤器,自定义 -->
<init-param>
<param-name>filtFlag</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<!-- 过滤jsp文件,自定义 -->
<filter-mapping>
<filter-name>OAuthFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
<!-- 过滤.do结尾url,自定义 -->
<filter-mapping>
<filter-name>OAuthFilter</filter-name>
<url-pattern>*.do</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
二、 在web-info下新建config目录,并加入OauthConfig.xml文件,具体说明如下:
<?xmlversion="1.0"encoding="UTF-8"?>
<OauthConfig>
<!--应用信任号,身份认证服务系统分配-->
<AppId>80100068</AppId>
<!--应用系统secret,身份认证服务系统分配 -->
<AppSecret>402880d35afe4c4d015afe515dce0001</AppSecret>
<!--获取资源作用域,多个可用;分隔(userInfo只获取用户资源) -->
<Scope>userInfo</Scope>
<!--应用系统回调地址,应用系统自己设定 -->
<RedirectUri>http:// 10.113.4.38:8080/appstep/firstAction!second.do</RedirectUri>
<!--重定向认证地址-->
<LoginURL>http://10.113.2.100/rsm/oauthServerAction.do?authorize</LoginURL>
<!--获取令牌API接口地址-->
<AccessTokenUrl>http://10.113.2.100/rsm/oauthServerAction.do?accessToken</AccessTokenUrl>
<RefreshTokenUrl>http://10.113.2.100/rsm/oauthServerAction.do?refresh_token</RefreshTokenUrl>
<!--错误提示页面url-->
<ErrorPage>/error.jsp</ErrorPage>
<!--API接口请求协议0 http 1 https-->
<HttpProtocol>0</HttpProtocol>
<!--不需要认证url-->
<NotAuthenticate>
<URI>error.jsp</URI>
<URI>visit.jsp</URI>
</NotAuthenticate>
</OauthConfig>
三、 Jar包说明
dom4j-1.6.1.jar解析xml,其他的解析json,如果与项目中jar重复可以不用引入
工会统一认证总结
最新推荐文章于 2024-01-25 11:53:53 发布