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

REST API Authentication #20

adamdriscoll opened this issue Feb 20, 2018 · 3 comments


None yet
3 participants
Copy link

commented Feb 20, 2018

The proposal is to provide the ability to generate and use JSON Web tokens

A new cmdlet could be defined to grant tokens. These tokens could then be used via the bearer header in HTTP requests to the REST API.

Grant-UDJsonWebToken -UserName -Expiration -Claims -Certificate

To configure authentication, a New-UDAuthenticationMethod could be specified on New-UDRestApi. For tokens generated by UD, you could specify the certificate and allow UD to decrypt and process the tokens.

New-UDAuthenticationMethod -Certificate

UD would also be able to be configured to validate tokens against a third-party service that provided the JWTs.

New-UDAuthenticationMethod -ValidateIssuerSigningKey -ValidateIssuer -ValidIssuer -IssuerSigningKey 

Then in order to use the key, you can just include it with the HTTP request via Invoke-RestMethod headers.

Invoke-RestMethod http://localhost:10000/api/resource -Headers @{Authorization = 'bearer TOKEN' }

This comment has been minimized.

Copy link

commented Feb 20, 2018

That would be AWESOME! Thank you for your work


This comment has been minimized.

Copy link

commented Feb 21, 2018

Would love to easily use it for authorization too. Not really sure what implementation might look like, but as a minimum I would like to be able to know the user that is connecting to API.


This comment has been minimized.

Copy link
Member Author

commented Feb 25, 2018

This is finished and will be in the next version. I'll be pushing a beta release today or tomorrow for people to try out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.