0

I am developing a mobile app and need to authenticate SharePoint 2013 from mobile app for the content.

How can this be implemented ?(without having to send the username and password with each request,looking for solutions that would not involve Azure ACS).

Please Help

0

Microsoft has launched new Office 356 API which can be used for Authentication.

Please check the below links, it will surely help you authenticating SharePoint from Mobile Apps without using the Azure ACS service, Although you will need to Azure to register the App so Azure Active Directory is used to authenticate and authorize users.

This is the code

 public static readonly string DiscoveryServiceResourceId = "https://api.office.com/discovery/";
    public const string Authority = "https://login.windows.net/common";
    public static readonly Uri DiscoveryServiceEndpointUri =
    new Uri("https://api.office.com/discovery/v1.0/me/");
    public static Uri returnUri = new Uri(ProvideUrlHere);
    public static string clientId = ""; // Client ID generated from Azure
    public static AuthenticationContext authContext = null;
    public static string SharePointURL = ""; // SharePoint Url
 public static async Task<AuthenticationResult> GetAccessToken(string serviceResourceId, PlatformParameters param)
    {
        authContext = new AuthenticationContext(Authority);
        if (authContext.TokenCache.ReadItems().Any())
            authContext = new AuthenticationContext(authContext.TokenCache.ReadItems().First().Authority);
        var authResult = await authContext.AcquireTokenAsync(serviceResourceId, clientId, returnUri, param);
        return authResult;
    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.