Playing Next Lesson In
Transcript
-
For this series, we're going to be taking a pre-existing AdonisJS web application and adding an API on top of it. Now, that API that we're going to be using is the one that we built inside of our building
-
with AdonisJS and Inertia series, but that series in itself is not a prerequisite for this series here. We're going to be picking up and kind of going over
-
the brief details that you need to know in order to actually continue with this series to get us up and running with the actual application that we're going to be using. Within the application itself,
-
this is really the only page that we're going to be altering. This is the organization settings page. And really, all that we're going to be doing is adding a brand new section onto this
-
to manage our organization's access tokens. The web application itself actually authenticates with a user using an email and password,
-
but our API is going to instead authenticate with access tokens against our organization itself. So we're going to be able to add an access token
-
directly against our organization. We're going to be able to give this access token a name so that we have a way to identify it. I'll just call this one test. And then we can also specify some vague permissions here as well,
-
like whether or not we want this token to be able to read, create records, update records, and delete records. And we can select whichever of those we deem applicable for the particular access token that we're creating.
-
Then we can create that access token, and it's going to show it to us this one and only time where we'll be able to copy it to our clipboard, say, "Okay, I got my token."
-
And now we have an access token ready to use that will give us read access to anything bound to this organization. So this panel right here is really the only thing
-
that we're going to be touching with the web application portion of this application. Everything else that we're going to be doing in this series is bound to adding an API on top of this application itself.
-
So for example, if we take our now copied access token, hop over into an API client, here I'm using an application called Hopscotch,
-
add a get request pointing to our application's local host domain, and here I have it pointing to an API version one organization endpoint.
-
If we try to hit this without specifying our access token, we're going to get an unauthorized access error. If we come into our headers, add in an authorization header
-
with that bearer token that we've copied, try sending this one more time, we're going to get back our organization's details, including its access levels, difficulties,
-
and statuses bound to it. Now, of course, there are a couple of things that you're going to need to know if you're not coming from our building with AdonisJS and Inertia series about this application
-
in order to successfully pick up and go from here. So we'll take the next couple of lessons to cover what those are. Those are going to include actually pulling down the repository itself from GitHub,
-
what the application itself looks like, and what our database schema looks like as well.
Goal of this Series
We'll cover the scope of this series and show some of the functionalities we'll be building throughout, which include an access token management panel, opaque access token authentication using an organization model, and building an API.

- Created by
- @tomgobich
- Published
Join the Discussion 0 comments
Be the first to comment!