Hi,
We have upgraded .Net core + angular 6.0 to .Net core + angular 7.0. After upgrading to 7.0 version, which components we created those are not working and throwing the errors.
1) ERROR ReferenceError: $ is not defined
2) jQuery__WEBPACK_IMPORTED_MODULE_7__(...).selectpicker
3) From list edit dropdown toggle is not working (edit, delete actions)
4) jQuery is not defined
5) $(self.roleComboboxElement.nativeElement).selectpicker('refresh');
Above all working in .Net core + angular 6.0 version and now it's not working (.Net core + angular 7.0)
Please help us to resolve these issues.
Thanks in advance
//qbd
We found the solution for single page application (AngularJS), any way we deicded to implement on server side for security reason.
Thanks all for response.
We are not able to find the solution for cross origin issue. If any one knows please let us know.
Thanks in advance!
I updated below code in appsettings.json file,
"App": { "ServerRootAddress": "http://localhost:22742/", "ClientRootAddress": "http://localhost:4200/", "CorsOrigins": "http://localhost:4200,http://localhost:49152,https://login.microsoftonline.com" },
I created Office365Login.component.js file and implemented below code
let options_: any = { client_id: client_id, client_secret: client_secret, redirect_uri: redirect_uri, code: authorization_code, grant_type: authorization_code,
headers: new HttpHeaders({
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": " POST, OPTIONS",
"Access-Control-Allow-Headers": "Origin, Content-Type, X-Auth-Token",
"Content-Type": "application/x-www-form-urlencoded",
})
}; //Here we are calling the office365 token api. this.http.request("post", "https://login.microsoftonline.com/{tenantid}/oauth2/token", options).subscribe(result => { console.log(result); });
I am implementing Office365 login auhtentication in SinglePageApplication-(.NET Core + Angular6) but I am getting below error... "Access to XMLHttpRequest at 'https://login.microsoftonline.com/{tenantid}/oauth2/token' from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource."
I am able to access this url "https://login.microsoftonline.com/{tenantid}/oauth2/token'" from post man and i am getting the required result .
Could you please help me to resolve this issue?
Thanks in advance.