Method to enable an Identity Provider (IdP) having an authorization gateway (AuthZ GW) and an authentication interface (AuthN API) to control the download and the execution of an authentication script component managed by a broker or by a service provider, said method comprises the steps of - for the broker, after reception of a request to get a web application login page (client.html) from an user agent, requesting a pre-authorization at the Authorization Gateway (AuthZ GW) with a broker identifier (BId) and contextual information relative to at least an end-user connection, receiving a random token in answer, requesting the creation (CrAFE) of an authentication script component with its URL as an Authentication Front End on the basis of the random token at a front-end delivery, said authentication front-end being able to retrieve currently observed contextual information at the user agent, embedding the random token and the URL for the authentication front-end in the web application login page (client.html) and sending the web application login page to the user agent, - for the front-end delivery, while receiving an authentication request to get the URL of the authentication front end with a token, provisioning the authentication front-end to the user-agent - for the authentication interface (AuthN API), while receiving, from the user-agent, API calls for authentication including at least the broker identifier (BId), the token and the currently observed contextual information, checking the currently observed contextual information, the broker identifier (BId) and the token, the authentication being positive if the currently observed contextual information and the broker identifier (BId) corresponds to the contextual information and broker identifier (BId) received in the pre-authorization request and if the token in the API call corresponds to the random token sent in answer to the pre-authorization request, and processing the request in case of positive authentication. - for the broker, after reception of a request to get a web application login page (client.html) from an user agent, requesting a pre-authorization at the Authorization Gateway (AuthZ GW) with a broker identifier (BId) and contextual information relative to at least an end-user connection, receiving a random token in answer, requesting the creation (CrAFE) of an authentication script component with its URL as an Authentication Front End on the basis of the random token at a front-end delivery, said authentication front-end being able to retrieve currently observed contextual information at the user agent, embedding the random token and the URL for the authentication front-end in the web application login page (client.html) and sending the web application login page to the user agent, - for the front-end delivery, while receiving an authentication request to get the URL of the authentication front end with a token, provisioning the authentication front-end to the user-agent - for the authentication interface (AuthN API), while receiving, from the user-agent, API calls for authentication including at least the broker identifier (BId), the token and the currently observed contextual information, checking the currently observed contextual information, the broker identifier (BId) and the token, the authentication being positive if the currently observed contextual information and the broker identifier (BId) corresponds to the contextual information and broker identifier (BId) received in the pre-authorization request and if the token in the API call corresponds to the random token sent in answer to the pre-authorization request, and processing the request in case of positive authentication.