<commit_before>Flask-OIDC
==========

Flask-OIDC is an extension to `Flask`_ that allows you to add `OpenID Connect`_
based authentication to your website in a matter of minutes. It depends
on Flask and `oauth2client`_. You can install the requirements from
PyPI with `easy_install` or `pip` or download them by hand.


Features
--------

- Support for OpenID Connect 1.0
- Support for OpenID Connect Discovery 1.0
- Support for OpenID Connect Dynamic Registration 1.0
- Friendly API
- Perfect integration into Flask
- Helper functions to allow resource servers to accept OAuth2 tokens


Installation
------------

Install the extension with `pip`::

    $ pip install Flask-OIDC



How to use
----------

To integrate Flask-OpenID into your application you need to create an
instance of the :class:`OpenID` object first::

    from flask.ext.oidc import OpenIDConnect
    oidc = OpenID(app)


Alternatively the object can be instantiated without the application in
which case it can later be registered for an application with the
:meth:`~OpenIDConnect.init_app` method.

Using this library is very simple: you can use
:data:`~OpenIDConnect.user_loggedin` to determine whether a user is currently
logged in using OpenID Connect.

If the user is logged in, you an use :meth:`~OpenIDConnect.user_getfield` and
:meth:`~OpenIDConnect.user_getinfo` to get information about the currently
logged in user.

If the user is not logged in, you can send them to any function that is
decorated with :meth:`~OpenIDConnect.require_login` to get them automatically
redirected to login.
<commit_msg>Document credential store<commit_after>Flask-OIDC
==========

Flask-OIDC is an extension to `Flask`_ that allows you to add `OpenID Connect`_
based authentication to your website in a matter of minutes. It depends
on Flask and `oauth2client`_. You can install the requirements from
PyPI with `easy_install` or `pip` or download them by hand.


Features
--------

- Support for OpenID Connect 1.0
- Support for OpenID Connect Discovery 1.0
- Support for OpenID Connect Dynamic Registration 1.0
- Friendly API
- Perfect integration into Flask
- Helper functions to allow resource servers to accept OAuth2 tokens


Installation
------------

Install the extension with `pip`::

    $ pip install Flask-OIDC



How to use
----------

To integrate Flask-OpenID into your application you need to create an
instance of the :class:`OpenID` object first::

    from flask.ext.oidc import OpenIDConnect
    oidc = OpenID(app)


Alternatively the object can be instantiated without the application in
which case it can later be registered for an application with the
:meth:`~OpenIDConnect.init_app` method.

Note that you should probably provide the library with a place to store the
credentials it has retrieved for the user. These need to be stored in a place
where the user themselves or an attacker can not get to them.
To provide this, give an object that has ``__setitem__`` and ``__getitem__``
dict APIs implemented as second argument to the :meth:`~OpenIDConnect.__init__`
call.
Without this, the library will only work on a single thread, and only retain
sessions until the server is restarted.

Using this library is very simple: you can use
:data:`~OpenIDConnect.user_loggedin` to determine whether a user is currently
logged in using OpenID Connect.

If the user is logged in, you an use :meth:`~OpenIDConnect.user_getfield` and
:meth:`~OpenIDConnect.user_getinfo` to get information about the currently
logged in user.

If the user is not logged in, you can send them to any function that is
decorated with :meth:`~OpenIDConnect.require_login` to get them automatically
redirected to login.

{'fraction_non_alphanumeric': 0.07206962197443569, 'fraction_numerical': 0.004351373402230079, 'mean_word_length': 4.202263083451203, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '55019', 'n_tokens_mistral': 1041, 'n_tokens_neox': 978, 'n_words': 502}