Can I configure access token TTL in spring auth server application.yml?

27 Views Asked by At

I need to change access token TTL in spring authorization server without writing additional code. It must be as simple as adding a line in application.yml The problem is what line and does such line exist.

I tried to add access-token-validity-seconds as

  security:
    oauth2:
      authorizationserver:
        client:
          qbr-client:
            registration:
              client-id: "${QBR_CLIENT_ID}"
              client-secret: "{noop}${QBR_CLIENT_SECRET}"
              client-authentication-methods:
                - "client_secret_basic"
              authorization-grant-types:
                - "client_credentials"
              access-token-validity-seconds: 3600

It does not work Please, tell me if such line exists.

1

There are 1 best solutions below

0
Alexander On

For anybody looking for the answer - this works

spring:
  security:
    oauth2:
      authorizationserver:
        client:
          qbr-client:
            registration:
              client-id: "${QBR_CLIENT_ID}"
              client-secret: "{noop}${QBR_CLIENT_SECRET}"
              client-authentication-methods:
                - "client_secret_basic"
              authorization-grant-types:
                - "client_credentials"
            token:
              access-token-time-to-live: 3600000