What are the main differences between JWT and OAuth authentication?

I have a new SPA with a stateless authentication model using JWT. I am often asked to refer OAuth for authentication flows like asking me to send ‘Bearer tokens’ for every request instead of a simple token header but I do think that OAuth is a lot more complex than a simple JWT based authentication. … Read more

Setting Authorization Header of HttpClient

I have an HttpClient that I am using for a REST API. However I am having trouble setting up the Authorization header. I need to set the header to the token I received from doing my OAuth request. I saw some code for .NET that suggests the following, httpClient.DefaultRequestHeaders.Authorization = new Credential(OAuth.token); However the Credential … Read more

Why Does OAuth v2 Have Both Access and Refresh Tokens?

Section 4.2 of the draft OAuth 2.0 protocol indicates that an authorization server can return both an access_token (which is used to authenticate oneself with a resource) as well as a refresh_token, which is used purely to create a new access_token: https://www.rfc-editor.org/rfc/rfc6749#section-4.2 Why have both? Why not just make the access_token last as long as … Read more

What’s the difference between OpenID and OAuth?

I’m really trying to understand the difference between OpenID and OAuth? Maybe they’re two totally separate things? 2Best Answer 21 OpenID is about authentication (ie. proving who you are), OAuth is about authorisation (ie. to grant access to functionality/data/etc.. without having to deal with the original authentication). OAuth could be used in external partner sites … Read more