0

I would like to create a simple console spring boot application which should read an URL from terminal then print its data then again read another URL and print its data and so on till pressing CTRL + C. The grant type to be used should be client credentials; the client credentials should be the same for every URL and should be conveyed to the application at startup using the spring boot Externalized Configuration capabilities. After 1th URL read the access token used in the process should be reused for the subsequent URLs; when expired/invalidated the access token should be transparently renewed/re-generated (using the refresh token if provided by the authorisation server in the 1th place or again the client credentials grant type).

The 6.6 OAuth 2.0 Client with e.g. 12.5 WebClient for Servlet Environments seems to fit the need but require to configure HttpSecurity (see 6.6 OAuth 2.0 Client) which I don't need because I'm not creating a web application but kind of a curl utility.

How would one benefit the features provided by those without having to configure HttpSecurity?

Community
  • 1
  • 1
Adrian
  • 3,321
  • 2
  • 29
  • 46
  • Short answer id say is no, you cant, longer answer wouldbe maybe with a lot of work. What you can do is run a command line in a spring boot app. https://www.baeldung.com/spring-boot-console-app – Toerktumlare Jun 24 '19 at 19:01

1 Answers1

-1

you can consider postman is a console application without http security config. I think you need to create your own login to store the token and then put it into the header for each restful call.

  • I could use curl or other means but the question is about how to do it in java with spring boot without `HttpSecurity` (I'm rewriting my question). So this is not answering the question, please remove the answer before someone rejects it. – Adrian Jun 25 '19 at 09:13