<commit_before># Getting Started

Xamarin.Auth helps you authenticate users against standard authentication mechanisms (e.g. OAuth), and store user credentials. It's also possible to authenticate against "wilder" services. The library is cross-platform, so once you learn it on iOS, you're all set on Android.




## 1. Create and configure an authenticator

Let's authenticate our user to access Skydrive:

    using Xamarin.Auth;
    ...
	var auth = new OAuth2Authenticator (
		clientId: "Client ID from https://manage.dev.live.com/Applications/Index",
		scope: "wl.basic,wl.skydrive",
		authorizeUrl: new Uri ("https://login.live.com/oauth20_authorize.srf"),
		redirectUrl: new Uri ("https://login.live.com/oauth20_desktop.srf"));

Skydrive uses OAuth 2.0 authentication, so we created an `OAuth2Authenticator`. Authenticators are responible for managing the user interface presented to the user and interacting with services to get them authenticated.

Authenticators take a variety of parameters. In this case, the application's client ID, its authorization scope, and Skydrive's various service locations are required.




## 2. Authenticate the user

While authenticators manage their UIs, it's up to you to actually present them on the screen.

	PresentViewController (auth.GetUI (), true, null);

This is a manual step so that you can present the UI however you want: modally, in navigation controllers, in popovers, wherever.
<commit_msg>'Our' sounds oddly possessive.<commit_after># Getting Started

Xamarin.Auth helps you authenticate users against standard authentication mechanisms (e.g. OAuth), and store user credentials. It's also possible to authenticate against "wilder" services. The library is cross-platform, so once you learn it on iOS, you're all set on Android.




## 1. Create and configure an authenticator

Let's authenticate a user to access Skydrive:

    using Xamarin.Auth;
    ...
	var auth = new OAuth2Authenticator (
		clientId: "Client ID from https://manage.dev.live.com/Applications/Index",
		scope: "wl.basic,wl.skydrive",
		authorizeUrl: new Uri ("https://login.live.com/oauth20_authorize.srf"),
		redirectUrl: new Uri ("https://login.live.com/oauth20_desktop.srf"));

Skydrive uses OAuth 2.0 authentication, so we created an `OAuth2Authenticator`. Authenticators are responible for managing the user interface presented to the user and interacting with services to get them authenticated.

Authenticators take a variety of parameters. In this case, the application's client ID, its authorization scope, and Skydrive's various service locations are required.




## 2. Authenticate the user

While authenticators manage their UIs, it's up to you to actually present them on the screen.

	PresentViewController (auth.GetUI (), true, null);

This is a manual step so that you can present the UI however you want: modally, in navigation controllers, in popovers, wherever.

{'fraction_non_alphanumeric': 0.07660597732737891, 'fraction_numerical': 0.006870491240123669, 'mean_word_length': 4.610789980732177, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3170212', 'n_tokens_mistral': 843, 'n_tokens_neox': 765, 'n_words': 353}