Code Monkey home page Code Monkey logo

Comments (14)

rpothier avatar rpothier commented on September 27, 2024

Hi @ravics09 Can you share a little more setup information? What is the working configuration, is the working case on the same machine? Is postman being used in the working case? There shouldn't be a mapping, have you tried with setting the explicit port in the command?

from conjur-quickstart.

ravics09 avatar ravics09 commented on September 27, 2024

Hi @rpothier ,

Setup Information:
Docker version - 2.5.0
OS - Windows 10
Yes I am trying postman on same machine to test conjur REST APIs. How I can set explicit port with the command.

Docker Setting

docker setting

default.config file
config

On conjur CLI I able to access those api. like
conjurcli

But when I try to access http://conjur using curl command on git bash I am not getting correct output.
failed

from conjur-quickstart.

venkatesh22pv avatar venkatesh22pv commented on September 27, 2024

I too trying same kind of scenario...trying to get secret from postman using restapi. Any solution found???

from conjur-quickstart.

rpothier avatar rpothier commented on September 27, 2024

Hi @ravics09 In the git bash case shouldn't that be run inside the container?
i.e. docker-compose exec client curl ...

from conjur-quickstart.

ravics09 avatar ravics09 commented on September 27, 2024

Hi @rpothier ,
Yes In git bash using docker-compose..... I am getting Authorization missing
bash

But After adding token manually it worked.
token

In case of postman, I am still facing issue. How we can access conjur rest apis in postman?
I searched regarding it but didn't find anything on internet.

from conjur-quickstart.

venkatesh22pv avatar venkatesh22pv commented on September 27, 2024

guys is there any way to can access conjur rest apis in postman???

from conjur-quickstart.

rpothier avatar rpothier commented on September 27, 2024

OK, thanks @ravics09 . So now it's ok with gitbash, and only an issue with Postman, is this correct?

from conjur-quickstart.

rpothier avatar rpothier commented on September 27, 2024

Also, @ravics09 and @venkatesh22pv for questions on the API to use in postman, you can refer to https://github.com/cyberark/conjur-openapi-spec/wiki

from conjur-quickstart.

ravics09 avatar ravics09 commented on September 27, 2024

Thanks @rpothier

I have given sometime on it and got success to access conjur api on postman.
Still one issue there for each api request I have to add access token manually in the request header.

Below request not generating token automatically
curl -H "$(conjur authn authenticate -H)" http://localhost:8080/whoami

So I tried below code and added token manually and it worked.

curl --request GET \
--url http://localhost:8080/whoami  \
--header 'authorization: Token token="XXXXXXXXX"

"$(conjur authn authenticate -H)"

is not working with postman to generate token.
Can you help me in it ? @rpothier @izgeri

from conjur-quickstart.

rpothier avatar rpothier commented on September 27, 2024

Hi @ravics09 How are you generating the token? Are you generating from the gitbash shell or the docker container.
you can generate the token by calling the docker container like this.
curl -H "$(docker-compose exec client conjur authn authenticate -H)" -k https://localhost:8443/whoami

from conjur-quickstart.

john-odonnell avatar john-odonnell commented on September 27, 2024

@ravics09 I've done a little digging into your issue.

Git-Bash

I think the problem you're experiencing is that the "$(conjur authn authenticate -H)" command substitution is occurring in your shell, and not in the client service, where the conjur executable resides.

This can be fixed by executing the command as a string, and escaping the contained " and $. This version of the command will substitute the authentication command from the shell of the client service, where it will execute successfully.

docker-compose exec client sh -c "curl -H \"\$(conjur authn authenticate -H)\" http://conjur/whoami"

Postman

I would like to understand the problem you're having with Postman further, as I'm currently working on a guide for exploring the Conjur API using Postman and the Conjur OpenAPI Spec. I have a preliminary version here if you want to take a look, any feedback is appreciated.

I think the problem is similar to the Git-Bash problem, where you are evoking conjur outside of the conjur-cli. In what context are you using the command $(conjur authn authenticate -H) in Postman? As a pre-request hook?

from conjur-quickstart.

ravics09 avatar ravics09 commented on September 27, 2024

Hi @rpothier ,
I am trying to generate token in postman.
I tried
curl -H "$(docker-compose exec client conjur authn authenticate -H)" -k https://localhost:8443/whoami

But its giving Authorization missing in response.

I don't want to generate access token in cli and use that in api call instead I want to generate access token with the api request in postman.

from conjur-quickstart.

rpothier avatar rpothier commented on September 27, 2024

Hi @ravics09
For the issues with Postman, please refer to @john-odonnell comments and the links he provided.

from conjur-quickstart.

rpothier avatar rpothier commented on September 27, 2024

Hi @ravics09 Since the remaining questions are with Postman, can we close this issue?

from conjur-quickstart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.