Graham
Graham

Reputation: 1

Azure Mobile App CORS settings

I am trying to migrate a Mobile Service .NET backend to a Mobile App .NET backend.

For the Mobile Service, I am able to configure CORS settings on the management portal and in web.config for local development settings, e.g.

<add key="MS_CrossDomainOrigins" value="http://localhost:8100"/>

How do I configure the CORS settings for a Mobile App ?

Thanks

Upvotes: 0

Views: 299

Answers (2)

Dale Anderson
Dale Anderson

Reputation: 1701

You can also configure allowed CORS domains through the Azure Portal under Settings -> CORS

Upvotes: 0

phillipv
phillipv

Reputation: 1717

CORS is the Apps world is now configured via the standard Web API models.

Something like so:

public static class WebApiConfig
{
    public static void Register(HttpConfiguration config)
    {
        var cors = new EnableCorsAttribute("www.mysite.com", "*", "*");
        config.EnableCors(cors);
    }
}

See: http://www.asp.net/web-api/overview/security/enabling-cross-origin-requests-in-web-api

Upvotes: 1

Related Questions