【问题标题】:Convert yml to application.properties将 yml 转换为 application.properties
【发布时间】:2020-01-31 01:17:39
【问题描述】:

我正在尝试在 Spring Boot 中创建一个过滤器,该过滤器从 aws cognito httpservletrequest 接收令牌并进行身份验证以使用我的 api。

我需要做的最后一件事是向我的 application.properties 添加一些属性。

不幸的是,我只有 yml 格式。

com:
  ixortalk:
    security:
        jwt:
          aws:
            userPoolId: "us-west-2_abcdefghi"
            identityPoolId: "us-west-2:xxxxxxxx-aaaa-bbbb-ccc-dddddddddddd"
            region: "us-west-2"

如何将其转换为属性?

有没有人使用https://github.com/IxorTalk/ixortalk.aws.cognito.jwt.security.filter/blob/master/README.md 对 Spring Boot 服务器使用 cognito 进行身份验证?那里有更好的东西吗?

【问题讨论】:

  • 你能不能格式化你的 yml sn-p => 使用 `` ``` - 也许我可以帮忙
  • 是的,我在上面。在我的手机上创建了问题:P

标签: java spring-boot jwt amazon-cognito


【解决方案1】:

你的application.properties 应该这样锻炼:

com.ixortalk.security.jwt.aws.userPoolId=us-west-2_abcdefghi
com.ixortalk.security.jwt.aws.identityPoolId=us-west-2:xxxxxxxx-aaaa-bbbb-ccc-dddddddddddd
com.ixortalk.security.jwt.aws.region=us-west-2

【讨论】:

    猜你喜欢
    • 2019-04-15
    • 1970-01-01
    • 2012-03-09
    • 2015-09-23
    • 2016-01-29
    • 1970-01-01
    • 1970-01-01
    • 2020-03-31
    • 1970-01-01
    相关资源
    最近更新 更多