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

API auth endpoint not working? #1298

Closed
andreasotto opened this issue Nov 9, 2016 · 7 comments
Closed

API auth endpoint not working? #1298

andreasotto opened this issue Nov 9, 2016 · 7 comments
Assignees

Comments

@andreasotto
Copy link

andreasotto commented Nov 9, 2016

In current development build the API endpoint /api/1/auth/request-token seems not to work (404 "Sorry, this page isn't available"). How to get an auth token?

Update: It's working from a curl request with credentials (but not from a browser request while logged in)

Additionally the .svg image from the html content in the page above is missing (broken link).

@wellingguzman
Copy link

Hey @andreasotto, the /api/1/auth/request-token is a POST endpoint. What are you trying to do? because when you are logged in, you can use the API as expected without any authorization required.

Additionally the .svg image from the html content in the page above is missing (broken link).

Are you requesting directly from your browser? the file exists on the repo. I'm going to take a look at it.

@andreasotto
Copy link
Author

Yes, the image is missing in the web page when the API is accessed with a
Browser. There is only a broken image sign and inspecting the object shows
a 404 for that file.

Am 09.11.2016 5:01 nachm. schrieb "Welling Guzmán" <notifications@github.com

:

Hey @andreasotto https://github.com/andreasotto, the
/api/1/auth/request-token is a POST endpoint. What are you trying to do?
because when you are logged in, you can use the API as expected without any
authorization required.

Additionally the .svg image from the html content in the page above is
missing (broken link).

Are you requesting directly from your browser? the file exists on the repo
https://github.com/directus/directus/blob/master/assets/img/directus-logo-flat.svg.
I'm going to take a look at it.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1298 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACB-a1kwYgW3hFDicFOeaQa1iwY-aFMOks5q8e5lgaJpZM4KtgZ3
.

@wellingguzman
Copy link

Weird, can you confirm that you have that the file exists on your filesystem? and can you show me the 404 not found requests?

@andreasotto
Copy link
Author

Well, the file is actually there in the assets/img dir - but the installation path (subdirectory in the hosts root folder) is missing in the file's URL in the resulting webpage.

Showing the image probably will work only if directus was installed at root level, and the file will be broken if not installed at root level.

@wellingguzman
Copy link

@andreasotto understood, it makes sense.

Also were you able to use the request token api endpoint correctly?

wellingguzman added a commit that referenced this issue Nov 10, 2016
@andreasotto
Copy link
Author

andreasotto commented Nov 10, 2016

Yes, the request token request works. From the documentation first it wasn't clear to me, that it has to be a POST request. I thought when logged in (active session) it would be possible to request the token with a GET request too.

@wellingguzman
Copy link

No, it's not possible, when logged in, you can go to you user page and get it from there.

I will close the ticket as the broken link was fixed and I will add a note in the documentation about the POST request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants