Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to Issue #4: MSA login does not work #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions OneDrivePhotoBrowser/AccountSelection.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ private enum ClientType
}

// Set these values to your app's ID and return URL.
private readonly string oneDriveForBusinessClientId = "Insert your OneDrive for Business client id";
private readonly string oneDriveForBusinessClientId = "<Insert your OneDrive for Business client id>";
private readonly string oneDriveForBusinessReturnUrl = "http://localhost:8080";
private readonly string oneDriveForBusinessBaseUrl = "https://graph.microsoft.com/";

private readonly string oneDriveConsumerClientId = "Insert your OneDrive Consumer client id";
private readonly string oneDriveConsumerReturnUrl = "https://login.live.com/oauth20_desktop.srf";
private readonly string oneDriveConsumerClientId = "<Insert your OneDrive Consumer client id>";
private readonly string oneDriveConsumerReturnUrl = "<Insert your OneDrive Consumer client Redirect id>";
private readonly string oneDriveConsumerBaseUrl = "https://api.onedrive.com/v1.0";
private readonly string[] scopes = new string[] { "onedrive.readonly", "wl.signin", "offline_access" };

Expand Down
12 changes: 9 additions & 3 deletions readme.md → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ To run the sample, you will need:

* Visual Studio 2013 or 2015, with Universal Windows App Development Tools **Note:** If you don't have Universal Windows App Development Tools installed, open **Control Panel** | **Uninstall a program**. Then right-click **Microsoft Visual Studio** and click **Change**. Select **Modify** and then choose **Universal Windows App Development Tools**. Click **Update**. For more info about setting up your machine for Universal Windows Platform development, see [Build UWP apps with Visual Studio](https://msdn.microsoft.com/en-us/library/windows/apps/dn609832.aspx).
* A Microsoft account and/or Azure Active Directory account with access to OneDrive for Business
* [Register your app for OneDrive authentication](https://dev.onedrive.com/app-registration.htm#register-your-app-for-onedrive)
* Knowledge of Windows Universal app development

### Download the sample
Expand All @@ -22,7 +23,12 @@ To run the sample, you will need:

### Associate the sample app with the Windows Store

Before you can run the sample to use with OneDrive Consumer, you must associate the app with the Windows Store. To do this, right-click the OneDrivePhotoBrowser project and choose **Store** | **Associate app with store**. Associating the app with the Windows store is reqiured for authentication to succeed.
* Before you can run the sample to use with OneDrive Consumer, you must associate the app with the Windows Store. To do this, right-click the OneDrivePhotoBrowser project and choose **Store** | **Associate app with store**. Associating the app with the Windows store is reqiured for authentication to succeed.
* Get the **App ID** and **Redirect URI** for your app and replace the values in *AccountSelection.xaml.cs* file for the following lines:
```csharp
private readonly string oneDriveConsumerClientId = "<Insert your OneDrive Consumer client id>";
private readonly string oneDriveConsumerReturnUrl = "<Insert your OneDrive Consumer client Redirect id>";
```

OneDrive for Business authentication does not require store association.

Expand All @@ -33,8 +39,8 @@ In order to authenticate using OneDrive for Business you'll need to enter your a
Replace the following values at the top of the file with your application details:

```csharp
private readonly string oneDriveForBusinessClientId = "Insert your AAD client ID here";
private readonly string oneDriveForBusinessReturnUrl = "Insert your AAD return URL here";
private readonly string oneDriveForBusinessClientId = "<Insert your AAD client ID here>";
private readonly string oneDriveForBusinessReturnUrl = "<Insert your AAD return URL here>";
```

For more details on setting up an application to access OneDrive for Business please read the [registration documentation](https://dev.onedrive.com/app-registration.htm#register-your-app-for-onedrive-for-business) for the API.
Expand Down