graphql-spring-boot icon indicating copy to clipboard operation
graphql-spring-boot copied to clipboard

How to set the bearer token dynamically in graphql-spring-boot playground

Open skesani opened this issue 1 year ago • 0 comments

Discussed in https://github.com/graphql-java-kickstart/graphql-spring-boot/discussions/928

Originally posted by skesani March 16, 2023 Hey All,

I am using playground embedded by accessing at root /playground, I am checking for a solution on how to set the bearer token based dynamically, current documentation shows, we can set the static token in .yml file like below, however i wanted to set the token programmatically since the token changes based on the user roles and when i navigate to /playground the token should set like below image, please let me know if this is possible? if so please provide a code sample for it. Thanks.

headers:
      Authorization: "Bearer <your-token>"

image

https://github.com/graphql-java-kickstart/graphql-spring-boot#enable-graphql-playground

skesani avatar Mar 16 '23 16:03 skesani