warrenbuckley / Umbraco-JWT-AuthTokens

This is a repository for providing a secure based API to perform backoffice actions using JWT Auth tokens
14 stars 19 forks source link

404 on token url #4

Open alastair-todd opened 8 years ago

alastair-todd commented 8 years ago

I've installed via nuget and recompiled the solution but a POST to http://{mysite}/umbraco/TokenAuth/SecureApi/Authorise returns a 404

Anything special needed to get that in the route table?

The project knows about the SecureApiController as I can create base a controller on it.

alastair-todd commented 8 years ago

Got it working by copy and pasting the SecureAPI class into my own controller (JwtTokenController).

Its useful. I'm using it to call an import API. Having done this already in another project I was aware of Postman parameters, would be useful to add that to the wiki.

For umbraco/jwtauth/JwtToken/gettoken

In the Body tab parameters of postman, select x-www-form-urlencoded and add two fields:

Username = {uid} Password = {pwd}

and POST - that will return the token in the Response Body

Then to make subsequent secure requests e.g. umbraco/{mypluginname}/{myplugincontroller}/{myplugincontrolleraction}

In the Headers tab parameters, add Authorization = Bearer {value of token}

oromand commented 7 years ago

Reason for that might come from the 1.1.0.0 version that brought enhancements. The repository doesn't reflect the binaries distributed. The entry points seem to be http://host/umbraco/TokenAuth/SecureApi/AuthoriseMember and http://host/umbraco/TokenAuth/SecureApi/AuthoriseUser. Same goes for attributes that have distinct user and member support as shown here : https://www.symbolsource.org/Public/Metadata/NuGet/Project/UmbracoAuthTokens/1.1.0.0/Release/.NETFramework,Version=v4.5.1/UmbracoAuthTokens

warrenbuckley commented 7 years ago

Hi @oromand I totally forgot about this project to be honest. You are most probably right that I forgot to publish the latest Nuget package from the latest source code when I was more actively working on 2yrs ago.

What I would recommend is to clone the source & build it so you can grab the DLLs in the meantime to when I can try to get time to look at this again.

oromand commented 7 years ago

To me, it looks the repository is behind nuget packages isn't it ? Any chance to have a branch for the version 1.1.0 ?

warrenbuckley commented 7 years ago

I could have stupidly published & not committed then. That is on an old machine, so I would need to check & verify at some point.

oromand commented 7 years ago

That would be great, this is a great piece of code; allowing decent authentication to take place within Umbraco

biapar commented 7 years ago

@oromand Is the problem solved?

oromand commented 7 years ago

For me it is.