小编Don*_*fin的帖子

使mockMVC测试过滤器的init例程需要什么?

我已经实现了以下CORS过滤器,它在服务器上执行代码时起作用:

/*
 *    Copyright 2013 BrandsEye (http://www.brandseye.com)
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or …
Run Code Online (Sandbox Code Playgroud)

junit mocking spring-mvc servlet-filters

19
推荐指数
2
解决办法
2万
查看次数

将Spring的Token Store作为MySQL文件实现的步骤是什么?

我有一个应用程序,目前使用Spring OAuth 2.0 In Memory Token Store.我需要将Spring Security OAuth 2.0 JAR转换为使用持久文件而不是内存来确保访问令牌在服务器重新启动时有效.Spring OAuth 2.0 JAR提供了使用JdbcTokenStore方法支持MYSQL数据库的例程,但是我无法找到任何文档来说明如何更改默认配置(使用InMemoryTokenStore方法)来使用支持的Jdbc方法.

我想听一下已经实现了Spring Security OAuth 2.0 JdbcTokenStore方法的人,并且可以提供执行此操作所需的配置示例,或者可以指向描述该过程的文档.我在互联网上搜索高低,但找不到任何此类文档.

我已经为Token Store找到了Spring Security OAuth 2.0模式文件,如果有人感兴趣,只能在Test Resource目录中找到它.任何Pivotal文档网站都没有记录它的存在.如果有必要,我可以阅读其余的Pivotal源代码,但我希望有人可以免除必须使用这条路径.

提前感谢您提供的任何帮助.

access-token spring-security-oauth2

18
推荐指数
2
解决办法
3万
查看次数