{% extends "base.html" %}

{% block content %}
<a href="{{ url_for("social.auth", backend="google-oauth2") }}">Google OAuth2</a> <br />
<a href="{{ url_for("social.auth", backend="google-oauth") }}">Google OAuth</a> <br />
<a href="{{ url_for("social.auth", backend="google") }}">Google OpenId</a> <br />
<a href="{{ url_for("social.auth", backend="twitter") }}">Twitter OAuth</a> <br />
<a href="{{ url_for("social.auth", backend="yahoo") }}">Yahoo OpenId</a> <br />
<a href="{{ url_for("social.auth", backend="yahoo-oauth") }}">Yahoo OAuth</a> <br />
<a href="{{ url_for("social.auth", backend="stripe") }}">Stripe OAuth2</a> <br />
<a href="{{ url_for("social.auth", backend="facebook") }}">Facebook OAuth2</a> <br />
<a href="{{ url_for("social.auth", backend="facebook-app") }}">Facebook App</a> <br />
<a href="{{ url_for("social.auth", backend="angel") }}">Angel OAuth2</a> <br />
<a href="{{ url_for("social.auth", backend="behance") }}">Behance OAuth2</a> <br />
<a href="{{ url_for("social.auth", backend="bitbucket") }}">Bitbucket OAuth</a> <br />
<a href="{{ url_for("social.auth", backend="box") }}">Box OAuth2</a> <br />
<a href="{{ url_for("social.auth", backend="linkedin") }}">LinkedIn OAuth</a> <br />
<a href="{{ url_for("social.auth", backend="github") }}">Github OAuth2</a> <br />
<a href="{{ url_for("social.auth", backend="foursquare") }}">Foursquare OAuth2</a> <br />
<a href="{{ url_for("social.auth", backend="instagram") }}">Instagram OAuth2</a> <br />
<a href="{{ url_for("social.auth", backend="live") }}">Live OAuth2</a> <br />
<a href="{{ url_for("social.auth", backend="vk-oauth2") }}">VK.com OAuth2</a> <br />
<a href="{{ url_for("social.auth", backend="dailymotion") }}">Dailymotion OAuth2</a> <br />
<a href="{{ url_for("social.auth", backend="disqus") }}">Disqus OAuth2</a> <br />
<a href="{{ url_for("social.auth", backend="dropbox") }}">Dropbox OAuth</a> <br />
<a href="{{ url_for("social.auth", backend="evernote-sandbox") }}">Evernote OAuth (sandbox mode)</a> <br />
<a href="{{ url_for("social.auth", backend="fitbit") }}">Fitbit OAuth</a> <br />
<a href="{{ url_for("social.auth", backend="flickr") }}">Flickr OAuth</a> <br />
<a href="{{ url_for("social.auth", backend="soundcloud") }}">Soundcloud OAuth2</a> <br />
<a href="{{ url_for("social.auth", backend="thisismyjam") }}">ThisIsMyJam OAuth1</a> <br />
<a href="{{ url_for("social.auth", backend="stocktwits") }}">Stocktwits OAuth2</a> <br />
<a href="{{ url_for("social.auth", backend="tripit") }}">Tripit OAuth</a> <br />
<a href="{{ url_for("social.auth", backend="clef") }}">Clef OAuth2</a> <br />
<a href="{{ url_for("social.auth", backend="twilio") }}">Twilio</a> <br />
<a href="{{ url_for("social.auth", backend="xing") }}">Xing OAuth</a> <br />
<a href="{{ url_for("social.auth", backend="yandex-oauth2") }}">Yandex OAuth2</a> <br />
<a href="{{ url_for("social.auth", backend="podio") }}">Podio OAuth2</a> <br />
<a href="{{ url_for("social.auth", backend="mineid") }}">MineID OAuth2</a> <br />

<form action="{{ url_for("social.auth", backend="openid") }}" method="post">
  <div>
    <label for="openid_identifier">OpenId provider</label>
    <input id="openid_identifier" type="text" value="" name="openid_identifier" />
    <input type="submit" value="Login" />
  </div>
</form>

<form action="{{ url_for("social.auth", backend="livejournal") }}" method="post">
  <div>
    <label for="openid_lj_identifier">LiveJournal ID</label>
    <input id="openid_lj_identifier" type="text" value="" name="openid_lj_user" />
    <input type="submit" value="Login" />
  </div>
</form>

<form method="post" action="{{ url_for("social.complete", backend="persona") }}">
  <input type="hidden" name="assertion" value="" />
  <a rel="nofollow" id="persona" href="#">Persona</a>
</form>
{% endblock %}

{% block scripts %}
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>
<script src="https://login.persona.org/include.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
    $('#persona').on('click', function (e) {
        e.preventDefault();
        var self = $(this);

        navigator.id.get(function (assertion) {
            if (assertion) {
                self.parent('form')
                        .find('input[type=hidden]')
                        .attr('value', assertion)
                        .end()
                    .submit();
            } else {
                alert('Some error occurred');
            }
        });
    });
});
</script>
{% endblock %}
