Logging into an application is a fundamental, crucial, and yet thankless experience. When it works correctly, most users gloss over its underlying complexity. It is not part of the core product experience but just an expectation. While designing the authorization stack developers have to weigh security versus convenience in authentication approaches.
The most common kinds of authentication in a web application are:
Basic authentication – send credentials with every request
Token based authentication – send credentials first time to receive a token, then use the token for all subsequent requests OAuth – it’s complicated
Basic Authentication is exactly what it implies – basic. In this method of authentication, the user credentials have to be passed along with every HTTP request, usually in the format of username:password as a Base64 encoded string. This is passed along in the Authorization header.
In Token Based Authentication the credentials have only to be supplied on login, upon which the auth server provides the client with a token signifying a valid user. All subsequent requests need to be supplied with the token to access protected resources.OAuth is an open authorization protocol which enables applications to access each other’s data. First let us define three entities that play their part in the OAuth authentication specification:
Client – this is front-end application, the interface that users can directly interact with.
Resource server – the server that contains the data of interest for the client
Authentication server – the server that provides the identity of the client to the resource server.
Now, depending on the use case, the authentication server and the resource server may be the same but it is not necessary to be so. Also there are multiple mechanisms by which an auth server implementing the OAuth specification may grant access to the resource server.
The OAuth grant types are:
Authorization code grant – This is most common use case of OAuth, for example- when applications are asking the user to login via Google/Facebook etc. where Google/Facebook etc. act as the authentication server for the resource server that you (your client application) is trying to access. At the end of the authentication flow, the resource server is granted an authorization token, which it provides to the client. The client then exchanges the authorization token to receive an access token and a refresh token (to renew the access token on expiry).
Implicit grant – This is a simplified authorization flow that can be used by public clients (for example: communication between web applications), where the access token is returned immediately without an extra authorization token exchange step. This has, in time, fallen out of practice and is generally not recommended. It is recommended that public clients use either authorization code grant or client credentials grant instead.
Client credentials grant – This grant type is used when the resource server is also the resource owner. This grant type flow occurs strictly between the resource server (the client in this case) and the authorization server and there is no participation of the end user. The resource server provides its own credentials (the Client ID and Client Secret) to the authorization server, which upon verification returns an access token, hence the name.
Password grant – This grant type flow returns an access token given a username and password. It is typically only used by a service’s own applications and not made available to third parties.
How does authorization server share access token with resource server?
This is not specified in the OAuth 2.0 protocol and has been left as an implementation detail. Generally, JWTs are used which is signed by the authorization server and verifiable by the resource server without querying the authorization server (public key encryption).
Throughout the blog I’ve used authentication and authorization interchangeably several times. Of which the two are not strictly the same, authentication deals identification while authorization deals with permissions, each without the other do not mean much. In this blog I’ve glossed over some of the most popular modes of authentication over the web. I’ll talk more on roles and authorization strategies in my next blog.
Lets bring your idea to life
How to aggregate different types of data from various online and offline platforms
Let’s assume that we want to analyze how people think about a specific topic or maybe how they react to a certain incident, or what are their opinions about a particular topic.
How to perform analysis of online as well as offline platforms?
Today in the digital age, we spend a lot of time on social networks. We share a lot of our personal moments on various social networks. Whether we are traveling to an adventurous location or having dinner in an exotic restaurant, we share those moments and emotions on social networks. Not only that, we also share our opinions and views towards a specific topic on social networks.
API’s play a very important role in how our application will run and documenting the API’s in a format that everyone in the organization can understand as what is happening in the application. We will discuss one of the most used API documenting specifications called OpenAPI specifications.
Write to us
Our well-designed processes, protocols and best practices ensure that security and compliance requirements are adhered to, irrespective of client location and project size.