Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kc-metadata-import
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hosting
fairlogin
kc-metadata-import
Commits
3344dc5b
Commit
3344dc5b
authored
2 years ago
by
Armin Felder
Browse files
Options
Downloads
Patches
Plain Diff
extend documentation
parent
c9169798
No related branches found
Branches containing commit
No related tags found
1 merge request
!1
initial
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+26
-2
26 additions, 2 deletions
README.md
main.py
+2
-2
2 additions, 2 deletions
main.py
with
28 additions
and
4 deletions
README.md
+
26
−
2
View file @
3344dc5b
# Keycloak SAML2 metadata feed importer
config
# requirements
Python3.10+
(optional) an external database, to keep track of the syncs, if there is no external DB, sqlite has to be selected
## use
install the required Python packages
```
bash
pip
install
-r
requirements.txt
```
prepare the configuration as mentioned below
run the sync script with
```
bash
./main.py
```
## configuration
### Environment variables
-
SAML2_METADATA_URL (e.g. https://eduid.at/md/aconet-registered.xml)
-
KEYCLOAK_URL (url to Keycloak instance)
-
KEYCLOAK_REALM (Keycloak realm)
-
KEYCLOAK_USER (Keycloak user)
-
KEYCLOAK_PASSWORD (Keycloak users password)
-
DB_TYPE (postresql, mysql or sqlite)
for external datbases
-
DB_USER (database user)
-
DB_PASSWORD (database password)
-
DB_HOST (dbms host)
-
DB_PORT (dbms port)
-
DB_DATABASE (database )
\ No newline at end of file
-
DB_DATABASE (database )
### mappings
edit ./attribute_mapping.json, key is the SAML2 attribute, value is the keycloak user attribute
### blacklist IDPs and or SPs
edit blacklist.json , for SPs list the clientId for IDPs the entityIds
\ No newline at end of file
This diff is collapsed.
Click to expand it.
main.py
+
2
−
2
View file @
3344dc5b
import
hashlib
#!/usr/bin/env python3
# import hashlib
import
json
import
os
import
sqlite3
from
datetime
import
datetime
from
pprint
import
pprint
import
database
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment