Open alastair-todd opened 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}
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
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.
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 ?
I could have stupidly published & not committed then. That is on an old machine, so I would need to check & verify at some point.
That would be great, this is a great piece of code; allowing decent authentication to take place within Umbraco
@oromand Is the problem solved?
For me it is.
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.