We have seen what is a cost issue and white brother is throwing and arat when two different prison applications
try to communicate with each other.
But here we have a valid reason, like my other application and back in application, both developed
by same person, same entity, and they how to communicate with each other.
And we should confirm that to browser so that court policy error should not be thrown by it.
For that, let's try to make some changes inside our backend application to resolve the cost issue firstly
and stop the server to our security config where we have made all security related configurations here.
Inside this strategy, you can go and look and search for us is a method of choice.
We have to call and inside that matter, all configured source, it means I want to configure my course
detail on the backend application inside that you have to pass the configuration, of course, and import
all the needed classes.
And we should also have an ATM because this is the one configuration on top of that.
We should also want our spring security to consider these configurations as well.
That's why we need and better in between them.
So clearly now you can see here I just called the card method and I aim to call Configure Source where
I'm passing all the configurations related to CofS class by ordering a method called get cast configuration.
It is obviously fine.
Also, if you want to create this entire configuration as a separate bin and your spring security smart
enough to identify card configurations.
So you can see I'm just trying to unload the origins from this orison only, which means any communication
to this back and server will be acceptor if the communication is coming from this domain or port, no
hostname.
If you have multiple, you can also pass the multiple values, haloed methods, history type methods.
I'm saying all type of treatment that should be allowed.
But if we have a specific requirement like only get and has to be allowed, you can define that astron
a credentials through which I'm setting, which indicates that credentialled also should be accepted
and this has to be used in case of secure communication.
Also headers.
I'm saying all kind of hurdles has to be alert.
And Maxi's I'm just setting 3600 socan, which means my browser will cache these configuration details
for 3600 seconds.
After that, it will try to make a fresh request to see whether the car's configurations are valid or
they changed or not will remain as configuration and enable.
Are backend application also to pass this information to the browser whenever the pre-flight request
happens and it will pass all these values to the browser, which indicates that this backend application
will accept the communication only from this orison.
Now we are going to start our server.
It may go to the main class like click on as Java application.
Now I will also go to the browser.
Let's try to close the previous session on the browser and open a fresh browser in the browser.
I'm trying to call localhost for 2.0, which will take me to the login page here.
I'm just entering happy at a great example.
Dot com.
One, two, three, four, five is a password on clicking the signing this time.
Thus signing is successful and we are landed on to the dashboard.
And you can see here, this is the name that is coming from the database.
Hi, Happy.
And you logged in as an admin role, which means that we resolve this issue successfully and established
a secured communication between our UI application and the backend application.
Let's try to click on the balance, which will return the balance and icon transaction details of the
user.
Well, but we are getting no response.
Let's try to go to the console and see what is happening here.
We are getting an error forbidden for zero three, which indicates that I can't make a call to this
service, but we have password value controls and we logged in into the application.
Everything has to work right, but the reason that we are getting four zero three years due to CSR of
but you may ask Log-in functionality work previously the login functionality works because that uses
the get.
So CSR will never throw whenever we try to use it, get better.
But CSR will be thrown when you have a post method because the reason is that will only try to get the
data on display, whereas a post may result into saving or deleting the data.
That's where we will get into CSR issues when two different artisans try to communicate with each other.
Let's try to see what the CSR have in detail in the next video and resolve the issue also.
Thank you.
And by.