Using the Credential Locker

With the release of Windows Phone 8.1, the Credential Locker service is now available for Windows Phone app developers. This is great news for both first time users and those of us already using the service in our Windows 8.1 Store apps.

This blog post is part of a series about how Windows Phone 8.1 affects developers. The series is written in collaboration with Microsoft evangelist Peter Bryntesson, check out his blog here.

The Credential Locker service simplifies the task of handling user credentials and to store them securely encrypted on the device your app is running. It also roam the credentials between devices along with the user Microsoft account.
Information is stored in the Credential Locker per user and cannot be shared between apps.

When

A common scenario for using the Credential Locker is if your app connect to services like social networking. By only asking the user for login information once and store it in the Credential Locker between sessions will provide a better user experience.

How to

Create a reference:

Store user credential method:

Retrieve list of all user credentials:

Retrieve list of user credentials by user name:

Retrieve list of user credentials by resource name:

Retrieve specific user credential by username and resource:

Delete user credential:

Best practices

  • Use the Credential Locker to store passwords, not large data blocks.
  • Make sure the user has successfully signed in and opted to save passwords before storing them in the Credential Locker.

Summary

Another option for handling user authentication is now available for you as a Windows Phone app developer. The Credential Locker service is introduced and you use it in the same way as in your Windows 8 apps.

Leave Reply