Now, in this lecture, let's try to get an authorization code, followed by access token by leveraging
that claim to details on the user details that we have created in the previous lecture.
So, as you know, you're not to know what role the endpoint you are and supported by our key clock.
We can invoke this URL with the get mateur since it is a get method.
I pasted that in the browser, and you can see it gives all the details about the endpoint to what else
that is exposed by my key Glock's hour, like we were discussing in the open, I reconnect with the
openi reconnect your key Glock's our or any identity and access management product.
They will expose a dedicated user info API to know the user identity details coming to the automation
core to grant flow.
First, we need to get an to code so far that the endpoint to all that we have to use is the authorization
endpoint.
So we can take this endpoint to Warrell.
And I came to the Bozeman application and pasted that endpoint to Aurel.
And since we have to invoke this endpoint too early to get method, you can see here I can pass all
the parameters that are needed by my key blocks away.
First, the claim data, how to argue during the first step.
You don't have to share BECKLIN secret.
You just have to give the client ID.
The client I.D. can be identified by going to the client and clicking easy up client.
So this is the client ID.
So just pass the client ID and response type.
We have to tell that I'm expecting an authorization code.
So we need to mention if BATAM response type is a call to code and scope is open and redirect, UARS
should match with what we configure, which is localhost eighty eight to one sample post that we can
mention the state param also.
So this is just like a C srf token to a white C SRF security issues.
So you can to any random generator value here, but this is completely optional.
Even if you don't do this also, it will work.
But for now, I'm just giving a random value around it.
So once you populated all these under Paton's, you get you are will become like this where all your
patterns are appended.
Like you can see client ID response type is equal to code.
Scope is called open, any redirect you ordered.
So now I cannot really invoke this.
You are with the postman.
The reason is as soon as I invoke this, you are a little login page and I can't login through Bowsman.
So for that reason, I take this and point to Warrell, which I built with the help of Bowsman.
And since this, you are an accep get method, I can go and paste it in the browser as soon as the base
turn on the click enter.
You can see I got a login page which inbuilt provided by my key closo.
So here I have to give the user details that I have created.
The user that I created these accounts and the password is one, two, three, four, five.
And any identity and access management server, including key log.
They also give flexibility to change this login page aspart.
You are business organization requirement.
So that user doesn't have to feel that they are trying to login into a different application.
But since now we are just for testing.
I'm just going and using the default login page as soon as I click sign in.
You can see I got an error page.
The reason is my geek closo.
So after successful authentication, it redirected to the redirected page, which is localhost 881 sample.
And here it is, passing the same state value that I passed to confirm there is no Kassav token issue.
And along with the session state, we also get a code.
So we need code, which is operation call.
So let's try to take the value present after code.
So this alteration code, I'll take it and I'll go to Boston, where I can pass this operation code
in the second step that we need to follow inside authorization grant type flow.
So here the endpoint to all that we need to invoke to get the access token is last token like we did
for our client counsel's grantee.
So since it's post invocation and how to parse all my details in that bardy, so grant type is authorization
code that we're trying to use here.
And client ID, we have to correct it before that.
Let me copy paste the code here.
So now I need to take the client ID for the same I came to the key of the client is easy, you white
client.
And declined to secret can be identified under the credentials tab.
So I'm just taking that and pasting another claim to secret and caught.
We already populated and redirect.
You are right.
We already mention it is the correct one, only like localhost, 88 to one sample scope is opening.
So with this, if I tried to invoke, I should get done successfulness once, but I'm getting an invalid
quote.
The reason is my code might tao expired.
So let me try to get the code again.
By invoking the same, you waddle through browser.
So I'm just copy pasting and invoking.
So since I already previously logged in this time, it's not asking me to log in again.
So I'm just taking the code here.
I'll pass that code here properly.
This time I should get a proper response.
So there you can see we got an access token, refresh token, I.D., token, everything.
But now we are more into start with the access token.
Let me take this access token and go to my account under authorization.
I should give you this access token after beta space.
So with this, if I tried to invoke, I should get a proper response and I got it, which is two hundred.
OK.
So this way we can consider authorization code grant type in order to get the authorization code initially.
Was that using operation code?
We can get an access token second time by passing client I.D. claim secret to that key.
Glock's what?
But can I go ahead and implement this approach?
Exactly.
Inside my UI angular application, I can't because I should not consider this approach inside my angular
you way application, because this approach needed claim secret to be passed through my client application
to keep Glock's over.
But you all know our Web applications like angular applications.
Anyone can see you are client I.D. and claim secret by looking at your JavaScript code are angular core
inside your browser.
But don't worry for client UI applications.
We have one more flavor of operation, a grant type flow, which we can discuss in that next lecture.
Thank you.
And bite.