
For microservices, there are a few differences that we will call out as we encounter them, and we talk about in more depth in Chapter VI: Authorization in Microservices. Our example architecture here is fairly monolithic.
Acme anvil password#
The Git service performs authentication using the same username and password pair as the Web application. These tokens are known as “bearer tokens” - a lightweight token that grants the bearer of the token access. The Web application also lets users create API tokens for interacting with the API application. After the initial authentication, the Web application returns a token to the user so that on subsequent requests they don’t need to resubmit their password. The API and Git connections will access the Filesystem (FS), where the Git repositories are stored.įor authentication (as a reminder: see the introduction for authentication vs authorization), our web application will handle authenticating the user using a simple username and password mechanism. The website and the API can access the database (DB), where information like user account data is kept.
Acme anvil full#
In a full system, a proxy can be made up of many parts, like load balancers and authenticating proxies. The proxy will then redirect connections to the right location. These can be SSH or HTTP connections.Īll the requests connect to one point: the Proxy, so named because it stands in for ("proxies") a web server.

We'll start with a reasonable architecture for our service, based on the fantastic documentation provided by the folks at GitLab on its production architecture. That means we need authorization! Website Architecture Users may or may not be able to read or make changes to a repository. One resource in GitClub is a repository, and repositories are access-restricted. GitClub offers a pure example of what motivates authorization in the first place - securing access to resources. It's very similar to real-life git hosts GitHub and GitLab.
Acme anvil code#
Our application is GitClub, a website for source code hosting, collaboration, and version control. To do that, we've built an example app where we can demonstrate each concept. We'd like to show you examples of authorization in practice, not just in theory. We assume you have an authentication system in place, or can set one up by following guidance readily available elsewhere. This course focuses on authorization, and will only touch on authentication when relevant. For instance, once a user is authenticated, we might use her username to look up her permissions or we might be able to infer her permissions based on some other attribute that we can look up. If authentication is the front door, authorization controls what doors you can open once you’re inside.Īuthorization often builds on authentication, and the two overlap most closely when information about who the user is becomes an input to determining what they can do. Other forms of authentication include OAuth and OpenID Connect (OIDC), which is often used for adding features like “Login with Google” or “Login with Facebook” and SAML, which is a standard that enterprises use for giving employees a single login across multiple apps.Īuthorization is the mechanism of controlling what the user can do.
Acme anvil verification#
For example, a username and password together make up an identity (username) and a verification method (do you know the password). But they aren’t the same thing.Īuthentication is the mechanism for verifying who a user is. Many folks often use the term “auth” to refer to both authentication and authorization, which are related and somewhat overlapping mechanisms in application security.

It's also usually unrelated to the core features or business logic that you're working on.

This guide will teach you those patterns.Īuthorization is a critical element of every application, but it's nearly invisible to users. There are a common set of architecture patterns for authorization that suit any application architecture - knowing those patterns makes writing authorization code much easier. It's how you make sure users have access to their own data, and aren't allowed to see data that isn't theirs. Authorization is the mechanism for controlling who can do what in an application.
