I am following this link to start the oAuth middleware after setting the required values, but i am getting below error message while running the command. Any idea what exactly is the issue?
daml-helper: Received ExitFailure 1 when running
Raw command: java -Dlogback.configurationFile=/home/rocky/.daml/sdk/2.6.4/daml-sdk/oauth2-middleware-logback.xml -jar /home/rocky/.daml/sdk/2.6.4/daml-sdk/daml-sdk.jar oauth2-middleware --config /oauth-middleware.conf
The path to your config file seems a bit weird - / is usually only writable by root. I suspect that path is wrong and that’s why the middleware is not starting.
It’s a bit unfortunate that it isn’t giving a more appropriate error message.
12:45:41.324 [main] WARN com.daml.auth.middleware.oauth2.Cli - Using cli opts for running oauth2-middleware is deprecated
12:45:41.611 [system-akka.actor.default-dispatcher-5] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started
12:45:42.292 [system-akka.actor.default-dispatcher-8] INFO c.daml.auth.middleware.oauth2.Main$ - Started server: ServerBinding(/0.0.0.0:3265)
My question is, how would i test endpoints in postman, I dont see any logs in the console when i hit below URL in postman-
/auth?claims=actAs:Alice+applicationId:MyApp
I’m unfortunately not very familiar with either Postman or the OAuth2 Middleware, so I’m not in a great position to help you. I’ll try to find someone who might be a better fit.
In order for the /auth endpoint to provide an authorised response, we need:
a valid access token to be supplied
and for that token to provide the requested claims.
As you are observing a response that appears to be consistent with an unauthorised response, I currently feel this might be the issue being displayed here?
example.com and oauth2-provider.com here are placeholders. If you haven’t done so, you need to populate all the URLs with real ones corresponding to your application (in place of example.com) and your token provider (in place of oauth2-provider.com. Eg use Auth0).