Skip to content

Latest commit

 

History

History
81 lines (60 loc) · 2.19 KB

windowsphone.md

File metadata and controls

81 lines (60 loc) · 2.19 KB
title name alias language hybrid image tags snippets
Windows Phone Tutorial
Windows Phone
win8
wp8
windows-phone
windows-phone-8
microsoft-phone
Javascript
C#
false
/media/platforms/windows-phone.png
quickstart
dependencies setup use
native-platforms/windows-phone/dependencies
native-platforms/windows-phone/setup
native-platforms/windows-phone/use

Windows Phone Tutorial

<%= include('../_includes/_package', { pkgRepo: 'Auth0.WindowsPhone', pkgBranch: 'master', pkgPath: 'examples/WindowsPhoneSilverlight', pkgFilePath: null, pkgType: 'none' }) %>

Otherwise, if you already have an existing application, please follow the steps below.

1. Install the Auth0.WindowsPhone package

You can either run the following command or install it via the Package Manager UI.

${snippet(meta.snippets.dependencies)}

2. Setting up the callback URL in Auth0

Go to the Application Settings section in the Auth0 dashboard and make sure that Allowed Callback URLs contains the following value:

https://${account.namespace}/mobile

3. Instantiate the Auth0 client

${snippet(meta.snippets.setup)}

4. Allow users to log in

${snippet(meta.snippets.use)}

5. Use server API if necessary:

var client = new HttpClient();

// Accessing public resource
var response = await client.GetAsync(new Uri("{YOUR API URL}/{PUBLIC RESOURCE}"));

// Accessing secured resource
// Initialize HTTP request message
var message = new HttpRequestMessage(HttpMethod.Get, new Uri("{YOUR API URL}/{SECURED RESOURCE}"));
// Add header so that server can recognize logged in user
message.Headers.Add("Authorization", "Bearer " + App.Auth0.CurrentUser.IdToken);
response = await client.SendRequestAsync(message);

6. Sit back and relax

Now it's time to sit back and relax. You've implemented log in and signup with Auth0 for your Windows Phone application.

Additional information

You can also check out the Github page access the source code, and additional documentation.