Open IgorEulalio opened 3 years ago
What version of Micronaut?
To generate this token, my call look like this:
const echoPostRequest = {
url: 'DNS_API/api/oauth/token',
method: 'POST',
header: 'Content-Type:application/x-www-form-urlencoded',
body: {
mode: 'urlencoded',
urlencoded: [
{ key: "client_id", value: "client_id" },
{ key: "client_secret", value: "client_secret" },
{ key: "grant_type", value: "client_credentials" },
]
}
};
I can't share the code because company policies, but i will try to explain at the maximum. Linked with this issue: https://github.com/micronaut-projects/micronaut-security/issues/12 Oriented by @sdelamo i create a new issue to relate my problem.
Explain: I have a lot of microservices, this microservices don't handle with the generate token process directly, have a thirdy party authorization in my company, that offers this urls: DNS_OF_MY_COMPANY/api/oauth/token DNS_OF_MY_COMPANY/api/oauth/token_info
When i receive a request, i receive a bearer token, and need to introspect that into token_info URL to validate.
When i need to call other microservices, depending on what microservices im calling, i need to generate a token into token url.
To do this, i have this code:
My http client:
My application.yml
By following these documentations of micronaut security: https://micronaut-projects.github.io/micronaut-security/latest/guide/#clientcredentials
But, when i call these microservices trough my microservices, the micronaut can't handle the authorization flow, and trow this exception: