{"id":19038387,"url":"https://github.com/fredex42/adfs_django","last_synced_at":"2026-06-05T16:32:03.139Z","repository":{"id":41785017,"uuid":"261489545","full_name":"fredex42/adfs_django","owner":"fredex42","description":"proof-of-concept for adfs login via django","archived":false,"fork":false,"pushed_at":"2023-01-06T05:09:22.000Z","size":1697,"stargazers_count":0,"open_issues_count":19,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-02T06:21:47.140Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fredex42.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-05T14:07:27.000Z","updated_at":"2020-05-11T17:00:51.000Z","dependencies_parsed_at":"2023-02-05T09:31:03.054Z","dependency_job_id":null,"html_url":"https://github.com/fredex42/adfs_django","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredex42%2Fadfs_django","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredex42%2Fadfs_django/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredex42%2Fadfs_django/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredex42%2Fadfs_django/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fredex42","download_url":"https://codeload.github.com/fredex42/adfs_django/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240094991,"owners_count":19746792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T22:03:02.048Z","updated_at":"2026-05-07T05:30:17.444Z","avatar_url":"https://github.com/fredex42.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# adfs-django\n\nProof of concept for Django authenticating against ADFS via django_saml2_auth\n\nThis is a simple project that authorizes both a django view and a REST endpoint (via a JWT auth token)\n\n## Setting it up (local dev run)\n\nYou need to obtain the federation metadata from the ADFS server as an XML file and save it locally.\nUpdate `config/__init__.py` to point to the location of the file.\n\n### 1. Build the frontend\nMake sure you have a recent node.js installed.\n\n```\n$ cd frontend/\n$ npm i\n$ npm run dev   #start up in dev mode, this monitors the files and does not optimize. run build for a \"production\" build\n```\n\n### 2. Standard django setup\nSet up a python virtualenv:\n```\n$ virtualenv -p python3.7 venv/\n$ source venv/bin/activate\n(venv) $\n```\n\nInstall requirements:\n```\n(venv) $ pip install -r requirements.txt\n```\n\nRun the dev server:\n```\n(venv) $ ./manage.py runserver 0.0.0.0:9000\n```\n\n### 3. Configure reverse proxy\nAuthentication requires an https url. The easiest way to provide this from a dev setup is to configure nginx to provide\na reverse proxy.\n\n1. First, install nginx.\nSee `nginx-snippet.conf` for sample server blocks for the nginx configuration.  Remove any server {} blocks already there\nand replace them.  The sample configures the hostname to be `myhost.local`, change this as you want.\nMake sure you update ALLOWED_HOSTS in `settings.py` or `config/__init__.py` to reflect the hostname you want.\n\n2. Next, you need an https certificate.  The easiest way to get this is to install https://github.com/FiloSottile/mkcert.\nSet it up as described in the README and generate your certificate by running `mkcert myhost.local` (replace myhost.local)\nwith the hostname you chose above.\nPut the certificate and key into the nginx config directory and check that the filenames are correctly specified\n in the configuration.\n\n3. Start up or restart nginx. It should now be configured to https terminate and redirect traffic from https://myhost.local\nto localhost:9000 (the dev server).\n\n### 4. Configure ADFS\n\nIn your ADFS configuration, you need to configure a \"Relaying Party\".  Use the URL as the identifier: \n`https://myhost.local/saml2_auth/acs/`.  You want an HTTP POST binding. The URL does not have to be resolvable from\nthe ADFS server.\n\n[TODO: add in other steps!]\n\nOnce that is sorted out, then you need to get hold of the federation metadata, either as a URL or as the full XML file.\nEither put the URL or path to locally downloaded XML file into the configuration at `adfs_django/config/__init__.py`.\n\nThen re-run the dev server.\n\nYou should now be able to access `https://myhost.local` (or whatever you specified instead) and get redirected out\nto ADFS for authentication and then bounced back again.\n\n## Setting it up (Docker run)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffredex42%2Fadfs_django","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffredex42%2Fadfs_django","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffredex42%2Fadfs_django/lists"}