Flask application initialization.

        :param app: An instance of :class:`flask.Flask`.
        :param entry_point_group: The entrypoint group name to load plugins.
            (Default: ``'invenio_oauth2server.scopes'``)

def init_app(self, app, entry_point_group='invenio_oauth2server.scopes',
                 **kwargs):
        """Flask application initialization.

        :param app: An instance of :class:`flask.Flask`.
        :param entry_point_group: The entrypoint group name to load plugins.
            (Default: ``'invenio_oauth2server.scopes'``)
        """
        self.init_config(app)

        state = _OAuth2ServerState(app, entry_point_group=entry_point_group)

        app.extensions['invenio-oauth2server'] = state
        return state