Skip to content

Commit

Permalink
Moved the sso module into a package
Browse files Browse the repository at this point in the history
If the templates are not in a package the setup.py is not able to
include the template directory in the installed package
  • Loading branch information
fmarco76 committed Jun 30, 2015
1 parent 43052a8 commit 98217c5
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion DiscourseSSO.py
Expand Up @@ -17,7 +17,7 @@
SSO Application tests
"""

import sso
from discourseSSO import sso

if __name__ == '__main__':
sso.app.run()
2 changes: 1 addition & 1 deletion DiscourseSSO.wsgi
Expand Up @@ -30,4 +30,4 @@ To run in a virtual environment add the activation code. Es.:
"""


from sso import app as application
from discourseSSO.sso import app as application
12 changes: 6 additions & 6 deletions README.rst
Expand Up @@ -76,7 +76,7 @@ using saml (for details on mod_shib configuration look at the `official wiki
When the server is properly configured download/clone the **DiscourseSSO** package
from `GitHub <https://github.com/fmarco76/DiscourseSSO>`_ in a directory accessible
by apache. Configure mod_wsgi to include the source code of the package and add
the `DiscourseSSO.wsgi` script to the location to use for Discourse. Finally, shibboleth
the ``DiscourseSSO.wsgi`` script to the location to use for Discourse. Finally, shibboleth
has to protect the authentication directory so the user has to go to the IdP in order
be accepted. The configuration should look like: ::

Expand All @@ -100,13 +100,13 @@ be accepted. The configuration should look like: ::

Finally, both Discourse and DiscourseSSO need to be configured. Enable the sso in
Discourse following the `official documentation <https://meta.discourse.org/t/official-single-sign-on-for-discourse/13045>`_.
The sso url to is the one going to your DiscourseSSO installation plus `sso/login`, so using
the above configuration the url is `https://<your-domain>/DisocurseSSO/sso/login`.
The sso url to is the one going to your DiscourseSSO installation plus ``sso/login``, so using
the above configuration the url is ``https://<your-domain>/DisocurseSSO/sso/login``.

The sso_secret is a random string and has to be the same in both services. The configuration
file of DiscourseSSO is `src/config.py` and it require the secret key (`DISCOURSE_SECRET_KEY`),
the url of Discourse (`DISCOURSE_URL`) and the name of the environment variables
where mod_shibb will provide the user information(`DISCOURSE_USER_MAP`). This is a
file of DiscourseSSO is ``src/discoruseSSO/config.py`` and it require the secret key (``DISCOURSE_SECRET_KEY``),
the url of Discourse (``DISCOURSE_URL``) and the name of the environment variables
where mod_shib will provide the user information(``DISCOURSE_USER_MAP``). This is a
map where the key is the attribute provided back to Discourse whereas the values
are the name of the variables to lookup. The name can be generated combining different
values but the other accept only one value. Default are good for a SAML based
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/sso.py → src/discourseSSO/sso.py
Expand Up @@ -29,7 +29,7 @@
import urllib

app = Flask(__name__)
app.config.from_object('default.Config')
app.config.from_object('discourseSSO.default.Config')
app.config.from_pyfile('config.py')
app.config.from_envvar('DISCOURSE_SSO_CONFIG', True)

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/test_sso.py
Expand Up @@ -22,7 +22,7 @@
import pytest
from urlparse import urlparse
from werkzeug.exceptions import BadRequest, Forbidden
import sso
from discourseSSO import sso

app = sso.app

Expand Down

0 comments on commit 98217c5

Please sign in to comment.