<commit_before># OAuth2 configuration

If you're building the Joind.In Android app, you'll need to set up the OAuth2 configuration.

First, you'll need an API key from the Joind.In website. When you set this up, you'll need to
supply a callback URL. This can be anything you want, but it must be a well-formed URL.  Make a
note of this, as you'll need it in the next step. An example might be:

**http://yourjoindin.dev/oauth-callback**

Note that the URL doesn't have to actually exist as a valid page - the app will intercept the
request and bring you back out of the OAuth process.

Next, you'll need to create a file called ``oauth.properties`` and place it in ``res/raw``.
The content should be similar to the following:

    api_key=<KEY>
    callback=http://your.callback/url

except inserting your API key and callback URL as appropriate.

Once you've placed this in, authentication via the app's settings page should work.<commit_msg>Adjust OAuth configuration doc re. new changes.<commit_after># OAuth2 configuration

If you're building the joind.in Android app, you'll need to set up the OAuth2 configuration.

It's best if you first set up the joind.in API locally - that way you can have full control over
the client configuration.

The Android app uses the OAuth2 "Client Credentials Flow" method of authentication - this means that
your client ID needs to be authorised by the API.

## Configuring the API
In the API project, open up `src/config.php` and add an entry to the `password_client_ids` file:

    $config =  array(
        'mode' => 'development',
        'oauth' => array(
            'password_client_ids' => array(
                // ...
                'androidapp',
            )
        ),
    );

This will allow credentials access with a client ID of "androidapp".

## Configuring the Android app
In the Android app project, you'll need to create a file called ``oauth.properties`` and place it
in ``res/raw``.  The content should be:

    client_id=androidapp

Once you've placed this in, authentication via the app's settings page should work when you build
the app and point it to your local API.
{'fraction_non_alphanumeric': 0.07032348804500703, 'fraction_numerical': 0.0023441162681669013, 'mean_word_length': 3.4, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 7, 'https://': 0, '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': '4295813', 'n_tokens_mistral': 590, 'n_tokens_neox': 565, 'n_words': 306}