Home > front end >  understanding the value of the crossorigin = "use credentials" attribute when it sends use
understanding the value of the crossorigin = "use credentials" attribute when it sends use

Time:10-29

I wanted to know if I understood correctly the meaning of the crossorigin attribute when it sends user data ...

As I understand it, there is a place on the server where it is marked (user data is written) which users can use this resource. Using the crossorigin attribute, user data is sent and when this user is found, it allows using this resource.

Please do not rate this question negatively. I have already read all the articles related to the crossorigin attribute on stackoverflow but got no answer.

CodePudding user response:

Yes. It's a way to provide support for CORS, it defines how an element (resource) handles a crossorigin request.
So it's similar to what you're saying, it's a way to get users' credentials without it needing to be known by you. There are other options, like anonymous. You can find all the information you need in the documentation. Here you have a link to one documentation with some explanation examples.
So, when a user wants to access a resource that it's set with crossorigin use-credentials, then it'll be necessary for the user to identify, using cookies, SSL certificate, whatever. This will go in the request and will reach the server. If their credentials are valid, they will be allowed to access the resource, if they don't, he won't have access to it.

  •  Tags:  
  • html
  • Related