Redirecting Confluence page from external website using basic authentication

I’ve been trying to redirect to Confluence page from my application using basic authentication.
I was able to retrieve the API using same credentials.

Now the problem is that I cannot redirect to the Confluence page. I keep on getting this error:

“Access to XMLHttpRequest at ‘’ (redirected from ‘localhost:1508/Home’) from origin ‘localhost:1508’ 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.”

My objective:
Redirect to Confluence page on hyperlink click from MyWebsite providing basic authentication. I mean Confluence page not Confluence application.

Is my objective possible?

Here’s the piece of my code:

                type: 'GET',
                url: '',
                beforeSend: function (xhr) {
                    xhr.setRequestHeader("Authorization", "Basic samplebasicauthentication");
                    xhr.setRequestHeader("X-Atlassian-Token", "no-check");
                    xhr.setRequestHeader ("Access-Control-Allow-Origin", "*");
                    xhr.setRequestHeader("Accept", "*/*");
                    xhr.setRequestHeader("Cache-Control", "no-cache");

                success: function (data) {