Authorization Bearer in URL Request using WSO2 API Manager -


is there way put authorization bearer in url request? curl command access api this:

curl -x --header 'accept: application/xml' --header 'authorization: bearer ebcd41ac-3466-3262-8c8e-3c73c987dbde' 'https://gateway.api.cloud.wso2.com:443/t/jab7180/prod/1.0.0/inquire/promos/ibm'

but if use request url in browser using https://gateway.api.cloud.wso2.com:443/t/jab7180/prod/1.0.0/inquire/promos/ibm, getting error message:

code = 900902 message: missing credentials description: required oauth credentials not provided. make sure api invocation call has header: "authorization: bearer access_token"

i hope can me because want access api browser , not curl command. thanks.

api manager uses org.wso2.carbon.apimgt.gateway.handlers.security.apiauthenticationhandler authenticate requests gateway using oauth authentication tokens. change behavior, have 3 options:

  1. delete authentication handler api definition on gateway (or velocity template, apply api publishing).
  2. create own authentication handler , replace default authentication handler in api definitions and/or velocity template. see: https://docs.wso2.com/display/am200/writing+custom+handlers
  3. create new handler takes authorization query string parameter , adds value headers of incoming request. add handler before authentication handler in handler workflow api.

that being said, why want this? there number of guis available make sending http requests straight-forward using browser (https://www.getpostman.com/) unless have reason change behavior, should not.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -