小编Ser*_*nik的帖子

Grails 3:集成测试在开发环境中运行,而不是在测试环境中运行

我已经分离了dataSourceConfig.yml数据库配置文件:

environments:
    development:
        dataSource:
            dbCreate: none
            url: jdbc:oracle:thin:xxxxxx
            driverClassName: oracle.jdbc.OracleDriver
            dialect: org.hibernate.dialect.Oracle10gDialect
            username: xxxx
            password: xxxx
    test:
        dataSource:
            dbCreate: none
            url: jdbc:oracle:thin:xxxxx
            driverClassName: oracle.jdbc.OracleDriver
            dialect: org.hibernate.dialect.Oracle10gDialect
            username: xxxxx
            password: xxxxx
Run Code Online (Sandbox Code Playgroud)

我连接到项目中的Application.java:

class Application extends GrailsAutoConfiguration implements EnvironmentAware {

    static void main(String[] args) {
        GrailsApp.run(Application, args)
    }

    @Override
    void setEnvironment(Environment environment) {
        String configPath = environment.getProperty("local.config.location")
        Resource resourceConfig = new FileSystemResource(configPath)
        YamlPropertiesFactoryBean ypfb = new YamlPropertiesFactoryBean()
        ypfb.setResources([resourceConfig] as Resource[])
        ypfb.afterPropertiesSet()
        Properties properties = ypfb.getObject()

        environment.propertySources.addFirst(new PropertiesPropertySource("local.config.location", properties)) …
Run Code Online (Sandbox Code Playgroud)

grails grails-3.1

5
推荐指数
1
解决办法
1596
查看次数

如何获取所有Auth0用户的列表

我想从Java API(auth0客户端)获取Auth0用户列表。我可以做吗?基于Java + Spring Security的API。我试图用RestTemplate做到这一点:

List findAllUsers(){
    String idToken = RestService.getIdToken()
    HttpHeaders headers = new HttpHeaders()
    headers.set("Authorization", "Bearer $idToken");
    List users = []
    try{
        ResponseEntity entity = restTemplate.exchange(issuer+"api/v2/users", HttpMethod.GET, new HttpEntity<Object>(headers), List)
        users = entity.getBody()
    } catch (HttpClientErrorException e){
        e.printStackTrace()
    }
    return users
}
Run Code Online (Sandbox Code Playgroud)

但是我正在获得403禁止状态。

java spring-security auth0

4
推荐指数
1
解决办法
3294
查看次数

标签 统计

auth0 ×1

grails ×1

grails-3.1 ×1

java ×1

spring-security ×1