Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error " invalid choice: 'jwt' " #13

Closed
tarkanlar opened this issue Nov 12, 2016 · 8 comments
Closed

Getting error " invalid choice: 'jwt' " #13

tarkanlar opened this issue Nov 12, 2016 · 8 comments
Assignees

Comments

@tarkanlar
Copy link

I installed latest version but getting this error
http: error: argument --auth-type/-A: invalid choice: 'jwt' (choose from 'basic', 'digest')

@hoatle hoatle self-assigned this Nov 13, 2016
@hoatle
Copy link
Member

hoatle commented Nov 13, 2016

thank you for your report, let me check and fix this.

@hoatle
Copy link
Member

hoatle commented Nov 13, 2016

@tarkanlar I've checked on both Python 2.7 and Python 3.5, it works.

$ pip install httpie
$ pip install httpie-jwt-auth
$ http teracy.com --auth-type=jwt --auth=abc: -v
GET / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Authorization: Bearer abc
Connection: keep-alive
Host: teracy.com
User-Agent: HTTPie/0.9.6

Could you show me the following information?
$ python --version, $ http --version, $ http --help, and then $ http teracy.com --auth-type=jwt --auth=abc: -v

Thanks.

@hoatle
Copy link
Member

hoatle commented Nov 19, 2016

@tarkanlar there must be something wrong with your installation. Feel free to reopen this issue if you still can not get it work properly. Thanks.

@hoatle hoatle closed this as completed Nov 19, 2016
@hoatle hoatle added the invalid label Nov 19, 2016
@tarkanlar
Copy link
Author

Thanks @hoatle I will try again

@karousn
Copy link

karousn commented Nov 20, 2018

I have the same error now with :
python : 2.7.15rc1
httpie : 0.9.8
message error : http: error: argument --auth-type/-A: invalid choice: 'jwt' (choose from 'basic', 'digest')

@hoatle
Copy link
Member

hoatle commented Nov 20, 2018

I've checked, works to me on Ubuntu 18.04

$ pip install --upgrade pip setuptools # could need to restart the terminal session
$ pip install --upgrade httpie
$ sudo pip install httpie-jwt-auth
$ http teracy.com --auth-type=jwt --auth=abc: -v
GET / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Authorization: Bearer abc
Connection: keep-alive
Host: teracy.com
User-Agent: HTTPie/1.0.0



HTTP/1.1 302 Moved Temporarily
Connection: keep-alive
Content-Length: 160
Content-Type: text/html
Date: Tue, 20 Nov 2018 14:44:28 GMT
Location: http://blog.teracy.com/
Server: nginx/1.6.2

<html>
<head><title>302 Found</title></head>
<body bgcolor="white">
<center><h1>302 Found</h1></center>
<hr><center>nginx/1.6.2</center>
</body>
</html>

@karousn
Copy link

karousn commented Nov 21, 2018

my issuer related to httpie/cli#566
i use sudo to install httpie and this plugin and it's work now.
Thanks

@willdzeng
Copy link

Was having the same issue, fixed by removing the system level httpie pacage:

sudo apt-get remove httpie 

and rerun

pip install httpie
pip install httpie-jwt-auth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants