django-esteid


Namedjango-esteid JSON
Version 4.0 PyPI version JSON
download
home_pagehttps://github.com/thorgate/django-esteid
SummaryDjango-esteid is a package that provides Esteid based authentication for your Django applications.
upload_time2023-11-21 14:43:01
maintainerJyrno Ader
docs_urlNone
authorThorgate
requires_python>=3.8.0,<4.0.0
licenseBSD
keywords esteid django smartid mobile-id idcard asice
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # django-esteid

[![pypi Status](https://badge.fury.io/py/django-esteid.png)](https://badge.fury.io/py/django-esteid)
[![CI](https://github.com/thorgate/django-esteid/actions/workflows/test.yml/badge.svg)](https://github.com/thorgate/django-esteid/actions/workflows/test.yml)
[![Coverage Status](https://coveralls.io/repos/github/thorgate/django-esteid/badge.svg?branch=master)](https://coveralls.io/github/thorgate/django-esteid?branch=master)

Django-esteid is a package that provides Esteid based authentication and signing for your Django applications.

## Quickstart

Install `django-esteid`:

    pip install django-esteid

Add `esteid` to installed apps:

    INSTALLED_APPS = [
        # ...
        'esteid',
        # ...
    ]

Please refer to the more detailed guides on [signing](esteid/signing) and [authentication](esteid/authentication).    

Be sure to read the [testing](#testing) section below.

Static files such as the services' logos and helper JS are also shipped with this library. 

### SmartID

Detailed docs are [here](esteid/smartid/README.md).

### MobileID

Detailed docs are [here](esteid/mobileid/README.md).

### ID Card

Detailed docs are [here](esteid/idcard/README.md).

### Service settings

You can 

### Context processors

`esteid.context_processors.esteid_services` adds service enabled/demo statuses to the template context.
This way you can easily manage the necessary services displayed on the auth/signing page.

## Testing

For a guide to authentication testing, please refer to [the authentication readme](./esteid/authentication/README.md).

There is a possibility to test the signing flow with ID card, SmartID 
and Mobile ID (the demo services) with the test views coming with the library.

**NOTE:** you may not be able to use the live Esteid services even with live credentials.
The live services keep an IP address whitelist 
which only contains IP addresses as specified in customer's contract.

To run the django-esteid test server with the test views, 
* install the virtual environment if not installed yet,
* run `./manage.py migrate` to create the SQLite DB for sessions,
* run `./manage.py runserver 8765`, where 8765 is a port of your liking

then visit the URL http://localhost:8765/ and follow the instructions on that page.

### Mobile ID

To test Mobile ID signing, you will need [test phone numbers and ID codes](https://github.com/SK-EID/MID/wiki/Test-number-for-automated-testing-in-DEMO).

You can not use real phone numbers or ID codes with the demo service.

### SmartID

To test signing with SmartID, yoy can use [the test ID codes](https://github.com/SK-EID/smart-id-documentation/wiki/Environment-technical-parameters).
 
You can also register a demo SmartID account and use a demo SmartID app to enter the PINs; please visit the
[demo SmartID portal](https://sid.demo.sk.ee/portal/login) for the details. 

### ID card

ID card signing requires SSL to work, even in a testing environment.  
Note that the signature will not be valid neither with the real certificates, nor with the test ones. 

To perform signing with ID card, you would need the `chrome-token-signing` browser plugin installed.
`apt-get install chrome-token-signing`

#### Testing with ssl

You can run an HTTPS webserver with `./manage.py runsslserver 127.0.0.1:8765`. It will use a development certificate
coming with the `djangosslserver` package. 

Note that the cert is self-signed, so you will need to create a security exception in browser.

If you need to create your own cert using openssl:
```
openssl req -x509 -out localhost.crt -keyout localhost.key \
  -newkey rsa:2048 -nodes -sha256 \
  -subj '/CN=localhost' -extensions EXT -config <( \
   printf "[dn]\nCN=localhost\n[req]\ndistinguished_name=dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
```
Then start the HTTPS webserver as follows: 

`python manage.py runsslserver 127.0.0.1:8765 --certificate localhost.crt --key localhost.key`

A security exception is also necessary as marked above.

#### ngrok
If you don't want to use a self-signed cert you can route the test site through HTTPS with [ngrok](https://ngrok.com/). 

With `ngrok` installed, and the `./manage.py runserver 8765` started, run
`ngrok http http://127.0.0.1:8765` and it will create a tunnel with an HTTPS URL for your local site.

### Verify demo containers with digidoc-tool

It's possible to use the command line utility `digidoc-tool` 
from the [libdigidocpp library](https://github.com/open-eid/libdigidocpp/)
to verify containers with signatures created by demo services:
```
digidoc-tool open --tslurl=https://open-eid.github.io/test-TL/tl-mp-test-EE.xml --tslcert=trusted-test-tsl.crt <file>
```
Instructions on setting up the environment 
[can be found here](https://github.com/open-eid/libdigidocpp/wiki/Using-test-TSL-lists#digidoc-toolexe-utility-program).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/thorgate/django-esteid",
    "name": "django-esteid",
    "maintainer": "Jyrno Ader",
    "docs_url": null,
    "requires_python": ">=3.8.0,<4.0.0",
    "maintainer_email": "jyrno42@gmail.com",
    "keywords": "esteid,django,smartid,mobile-id,idcard,asice",
    "author": "Thorgate",
    "author_email": "info@thorgate.eu",
    "download_url": "https://files.pythonhosted.org/packages/28/4c/c669cfc7b7b7803777e7081295bb5fc5a01ab218d0f0ee9b41acba7643f7/django_esteid-4.0.tar.gz",
    "platform": null,
    "description": "# django-esteid\n\n[![pypi Status](https://badge.fury.io/py/django-esteid.png)](https://badge.fury.io/py/django-esteid)\n[![CI](https://github.com/thorgate/django-esteid/actions/workflows/test.yml/badge.svg)](https://github.com/thorgate/django-esteid/actions/workflows/test.yml)\n[![Coverage Status](https://coveralls.io/repos/github/thorgate/django-esteid/badge.svg?branch=master)](https://coveralls.io/github/thorgate/django-esteid?branch=master)\n\nDjango-esteid is a package that provides Esteid based authentication and signing for your Django applications.\n\n## Quickstart\n\nInstall `django-esteid`:\n\n    pip install django-esteid\n\nAdd `esteid` to installed apps:\n\n    INSTALLED_APPS = [\n        # ...\n        'esteid',\n        # ...\n    ]\n\nPlease refer to the more detailed guides on [signing](esteid/signing) and [authentication](esteid/authentication).    \n\nBe sure to read the [testing](#testing) section below.\n\nStatic files such as the services' logos and helper JS are also shipped with this library. \n\n### SmartID\n\nDetailed docs are [here](esteid/smartid/README.md).\n\n### MobileID\n\nDetailed docs are [here](esteid/mobileid/README.md).\n\n### ID Card\n\nDetailed docs are [here](esteid/idcard/README.md).\n\n### Service settings\n\nYou can \n\n### Context processors\n\n`esteid.context_processors.esteid_services` adds service enabled/demo statuses to the template context.\nThis way you can easily manage the necessary services displayed on the auth/signing page.\n\n## Testing\n\nFor a guide to authentication testing, please refer to [the authentication readme](./esteid/authentication/README.md).\n\nThere is a possibility to test the signing flow with ID card, SmartID \nand Mobile ID (the demo services) with the test views coming with the library.\n\n**NOTE:** you may not be able to use the live Esteid services even with live credentials.\nThe live services keep an IP address whitelist \nwhich only contains IP addresses as specified in customer's contract.\n\nTo run the django-esteid test server with the test views, \n* install the virtual environment if not installed yet,\n* run `./manage.py migrate` to create the SQLite DB for sessions,\n* run `./manage.py runserver 8765`, where 8765 is a port of your liking\n\nthen visit the URL http://localhost:8765/ and follow the instructions on that page.\n\n### Mobile ID\n\nTo test Mobile ID signing, you will need [test phone numbers and ID codes](https://github.com/SK-EID/MID/wiki/Test-number-for-automated-testing-in-DEMO).\n\nYou can not use real phone numbers or ID codes with the demo service.\n\n### SmartID\n\nTo test signing with SmartID, yoy can use [the test ID codes](https://github.com/SK-EID/smart-id-documentation/wiki/Environment-technical-parameters).\n \nYou can also register a demo SmartID account and use a demo SmartID app to enter the PINs; please visit the\n[demo SmartID portal](https://sid.demo.sk.ee/portal/login) for the details. \n\n### ID card\n\nID card signing requires SSL to work, even in a testing environment.  \nNote that the signature will not be valid neither with the real certificates, nor with the test ones. \n\nTo perform signing with ID card, you would need the `chrome-token-signing` browser plugin installed.\n`apt-get install chrome-token-signing`\n\n#### Testing with ssl\n\nYou can run an HTTPS webserver with `./manage.py runsslserver 127.0.0.1:8765`. It will use a development certificate\ncoming with the `djangosslserver` package. \n\nNote that the cert is self-signed, so you will need to create a security exception in browser.\n\nIf you need to create your own cert using openssl:\n```\nopenssl req -x509 -out localhost.crt -keyout localhost.key \\\n  -newkey rsa:2048 -nodes -sha256 \\\n  -subj '/CN=localhost' -extensions EXT -config <( \\\n   printf \"[dn]\\nCN=localhost\\n[req]\\ndistinguished_name=dn\\n[EXT]\\nsubjectAltName=DNS:localhost\\nkeyUsage=digitalSignature\\nextendedKeyUsage=serverAuth\")\n```\nThen start the HTTPS webserver as follows: \n\n`python manage.py runsslserver 127.0.0.1:8765 --certificate localhost.crt --key localhost.key`\n\nA security exception is also necessary as marked above.\n\n#### ngrok\nIf you don't want to use a self-signed cert you can route the test site through HTTPS with [ngrok](https://ngrok.com/). \n\nWith `ngrok` installed, and the `./manage.py runserver 8765` started, run\n`ngrok http http://127.0.0.1:8765` and it will create a tunnel with an HTTPS URL for your local site.\n\n### Verify demo containers with digidoc-tool\n\nIt's possible to use the command line utility `digidoc-tool` \nfrom the [libdigidocpp library](https://github.com/open-eid/libdigidocpp/)\nto verify containers with signatures created by demo services:\n```\ndigidoc-tool open --tslurl=https://open-eid.github.io/test-TL/tl-mp-test-EE.xml --tslcert=trusted-test-tsl.crt <file>\n```\nInstructions on setting up the environment \n[can be found here](https://github.com/open-eid/libdigidocpp/wiki/Using-test-TSL-lists#digidoc-toolexe-utility-program).\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "Django-esteid is a package that provides Esteid based authentication for your Django applications.",
    "version": "4.0",
    "project_urls": {
        "Homepage": "https://github.com/thorgate/django-esteid",
        "Repository": "https://github.com/thorgate/django-esteid"
    },
    "split_keywords": [
        "esteid",
        "django",
        "smartid",
        "mobile-id",
        "idcard",
        "asice"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ac93384812a59d25260718c03937378d9f6e3cad7ae4b290757d4c1404b73d26",
                "md5": "66ca5c4a97b0571c2075bf6e7567b6ea",
                "sha256": "4e4d213de5c15256e67c5f028cd84d22ec618d8581b122158256ba9b7745fdf8"
            },
            "downloads": -1,
            "filename": "django_esteid-4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "66ca5c4a97b0571c2075bf6e7567b6ea",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8.0,<4.0.0",
            "size": 127466,
            "upload_time": "2023-11-21T14:42:59",
            "upload_time_iso_8601": "2023-11-21T14:42:59.667589Z",
            "url": "https://files.pythonhosted.org/packages/ac/93/384812a59d25260718c03937378d9f6e3cad7ae4b290757d4c1404b73d26/django_esteid-4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "284cc669cfc7b7b7803777e7081295bb5fc5a01ab218d0f0ee9b41acba7643f7",
                "md5": "b6684210d3748ef4a35cc5f64a410892",
                "sha256": "6fb5defe2e80ec4fcca33f45ab9b6684da57f6aa7df86138ed602a1821076559"
            },
            "downloads": -1,
            "filename": "django_esteid-4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "b6684210d3748ef4a35cc5f64a410892",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8.0,<4.0.0",
            "size": 93587,
            "upload_time": "2023-11-21T14:43:01",
            "upload_time_iso_8601": "2023-11-21T14:43:01.271455Z",
            "url": "https://files.pythonhosted.org/packages/28/4c/c669cfc7b7b7803777e7081295bb5fc5a01ab218d0f0ee9b41acba7643f7/django_esteid-4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-21 14:43:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "thorgate",
    "github_project": "django-esteid",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "django-esteid"
}
        
Elapsed time: 0.13802s