Origin https://someurl.sharepoint.com not found in Access-Control-Allow-Origin header. Skip to main content
https://support.okta.com/help/answers?id=9062a000000bmogqay&refurl=http%3a%2f%2fsupport.okta.com%2fhelp%2fanswers
How satisfied are you with the Okta Help Center?
Thank you for your feedback!
How satisfied are you with the Okta Help Center?
1
2
3
4
5
Very Dissatisfied
Very satisfied
Enter content less than 200 characters.
Ask Search:
Sachin SrivastavaSachin Srivastava 

Origin https://someurl.sharepoint.com not found in Access-Control-Allow-Origin header.

I am trying to retrive apps assigned to users from Okta site and show on my Office 365 site. I am using a API call "https://someurl-online.okta.com/api/v1/apps?filter=user.id+eq+"00u1c4hgl3hhytZCS1t7" ". But I am getting "Origin https://someurl.sharepoint.com not found in Access-Control-Allow-Origin header." error.
Note: I have already added the my Office 365 URL in Trusted Origins.
 Please help me how to I resolve this issue. Please find my complete code snippet below..

function GetApps() {
 
    var baseUrl ='https://someurl-online.okta.com';
    $.ajax({
        url: baseUrl + '/api/v1/apps?filter=user.id+eq+\"00u1c4hgl3hhytZCS1t7\"',
        type: 'GET',       
        dataType:'json',
        crossOrigin: true,               
        "headers": {
         
            "Authorization": "SSWS 00nK846raQeJqR7HslQESSdPkVPWBfj1Hjmx7mCl18",
            "Accept": "application/json, text/plain, */*"           
           
        }
    }).done(function (data) {
        console.log(data);
        var arrayLength = data.length;
        for (var i = 0; i < arrayLength; i++) {
            var label=data[i].label;
            var imgurl=data[i].logoUrl;
            var link=data[i].linkUrl;
            $("#divApps").append("<img src='"+imgurl+"' /><a href='"+link+"'>"+label+"</a>");
        }
    })
    .fail(function (xhr, textStatus, error) {
        var title, message;
        switch (xhr.status) {
            case 403:
                title = xhr.responseJSON.errorSummary;
                message = 'Please login to your Okta organization before running the test';
                break;
            default:
                title = 'Invalid URL or Cross-Origin Request Blocked';
                message = 'You must explictly add this site (' + window.location.origin + ') to the list of allowed websites in your Okta Admin Dashboard';
                break;
        }
        alert(title + ': ' + message);
    });
}
 
Richard DeJesusRichard DeJesus (Okta, Inc.)
You might need to follow this https://support.okta.com/help/articles/Knowledge_Article/50360933-Cross-Origin-Resource-Sharing
Charles FortuneCharles Fortune (Okta, Inc.)
Sachin,
I was not able to reproduce the error but attempted your query in Postman. Here is a query that returns the apps assigned to a user.

{{url}}/api/v1/apps?filter=user.id+eq+"00u9fa1b2dxm84g480h7"&expand=user/00u9fa1b2dxm84g480h7

and reference:

http://developer.okta.com/docs/api/resources/apps.html#list-applications-assigned-to-user