<section id="social-facebook">
    <title>Facebook</title>
    <para>
        To enable login with Facebook you first have to create an app in the
        <ulink url="https://developers.facebook.com/">Facebook Developer Console</ulink>. Then you need to copy
        the client id and secret into the Keycloak Admin Console.
    </para>
    <orderedlist>
        <listitem>
            <para>
                Log in to the <ulink url="https://developers.facebook.com/">Facebook Developer Console</ulink>. Click
                <literal>Apps</literal> in the menu and select <literal>Create a New App</literal>. Use any value for
                <literal>Display Name</literal> and <literal>Category</literal> you want, then click the
                <literal>Create App</literal> button. Wait for the project to be created (this may take a while). If after
                creating the app you are not redirected to the app settings, click on <literal>Apps</literal> in the
                menu and select the app you created.
            </para>
        </listitem>
        <listitem>
            <para>
                Once the app has been created click on <literal>Settings</literal> in sidebar on the left. Then click
                on <literal>Advanced</literal>. Under <literal>Security</literal> make sure
                <literal>Client OAuth Login</literal> is enabled. In <literal>Valid OAuth redirect URIs</literal> insert
                the <link linkend="social-callbackurl">social callback url</link>. Scroll down and click on the
                <literal>Save Changes</literal> button.
            </para>
        </listitem>
        <listitem>
            <para>
                Click <literal>Status &amp; Review</literal> and select <literal>YES</literal> for <literal>Do you want
                to make this app and all its live features available to the general public?</literal>.
            </para>
        </listitem>
        <listitem>
            <para>
                Click <literal>Basic</literal>. Copy <literal>App ID</literal> and <literal>App Secret</literal>
                (click <literal>show</literal>) from the <ulink url="https://developers.facebook.com/">Facebook Developer Console</ulink> into the
                settings page in the Keycloak Admin Console as the <literal>Key</literal> and <literal>Secret</literal>. Then
                click <literal>Save</literal> in the Keycloak Admin Console to enable login with Facebook.
            </para>
        </listitem>
    </orderedlist>
    <tip>
        <para>
            Facebook doesn't allow <literal>localhost</literal> in the redirect URI. To test on a local server
            replace <literal>localhost</literal> with <literal>127.0.0.1</literal>.
        </para>
    </tip>
</section>