【问题标题】:How do I change the expires_in value for an authentication token?如何更改身份验证令牌的 expires_in 值?
【发布时间】:2021-01-07 03:48:27
【问题描述】:

我尝试按照下面提到的 URL 的博客中的所有步骤进行操作。

https://blogs.sap.com/2019/04/29/sap-cloud-platform-backend-service-tutorial-13-api-called-from-external-tool/

虽然我正在获取身份验证令牌并且整个流程正常运行,但我无法更改 expires_in 的值,默认值为 43199。

如何将其更改为其他值,比如 5 分钟(300 秒)?

【问题讨论】:

    标签: oauth-2.0 cloud sap-cloud-platform cloudfoundry-uaa


    【解决方案1】:

    您可以在 xs-security.json 或 manually update 使用 cf update-service <uaa_instance_name> -c <json_file | inline-JSON object> 的 uaa 中将其包含在 UAA 配置中

    "oauth2-configuration": {
          "token-validity": 7200
    }
    

    为了完整起见,这里是一个示例 UAA JSON

    {
      "xsappname": "example_uaa",
      "tenant-mode": "dedicated",
      "description": "Security profile of called application",
      "scopes": [
        {
          "name": "uaa.user",
          "description": "UAA"
        }
      ],
      "oauth2-configuration":{ 
          "token-validity": 7200
       },
      "role-templates": [
        {
          "name": "Token_Exchange",
          "description": "UAA",
          "scope-references": [
            "uaa.user"
          ]
        }
      ]
    }
    
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-08-22
      • 1970-01-01
      • 2023-03-12
      • 2017-06-13
      • 1970-01-01
      • 1970-01-01
      • 2016-09-29
      相关资源
      最近更新 更多