Depending on your usecase, a quick setup would be to use https://auth0.com/ They have a lot of documentation and samples to get started.
We have implemented it for authentication with a Asp.Net Core webservice, with a REST based API. Authorization is also possible, either by working with the JWT token scopes, or using the Auth0 app_metadata.
Depends on what you want. You can just use an API key if it's for easy access, through a header.
If you want more, then use username + pass. Encrypt both or generate something from both of them. Eg. encrypt(username):encrypt(pass) If you want more, use private & public keys, which receive a session token the first time ( when authenticating). ... I think the end result would be a self hosted oauth server with permission management.
Authentication is such a mess, I don't even know where to begin. Most APIs rely on some sort of token-based auth, communicated via the header format: "Authorization: Bearer abc123", as opposed to placing it in the Cookie, as most web sites will do. Many solutions exist, like OAuth2, JWT, etc. but that's ultimately what it all boils down to.
If you use a cookie for an API, it will look like you don't know what you are doing. Also, there are extra rules around Cookies (expiration, length, etc.) that may bite you if you use them outside a browser context.
Comments (249) 36 threads
Earlier commentsWe have implemented it for authentication with a Asp.Net Core webservice, with a REST based API. Authorization is also possible, either by working with the JWT token scopes, or using the Auth0 app_metadata.
If you want more, then use username + pass. Encrypt both or generate something from both of them. Eg. encrypt(username):encrypt(pass)
If you want more, use private & public keys, which receive a session token the first time ( when authenticating).
...
I think the end result would be a self hosted oauth server with permission management.
All comments shown.
Couldn't load more comments. Check your connection and try again.