Skip to content

SimpleSAML integration to support FAU's StudOn#127

Open
NIKL45 wants to merge 17 commits into
Garmelon:masterfrom
NIKL45:simpleSAML-integration
Open

SimpleSAML integration to support FAU's StudOn#127
NIKL45 wants to merge 17 commits into
Garmelon:masterfrom
NIKL45:simpleSAML-integration

Conversation

@NIKL45

@NIKL45 NIKL45 commented Oct 24, 2025

Copy link
Copy Markdown

As discussed in issue #126, I implemented the SimpleSAML login method simple-saml.
My implementation is based (and tested) on the ILIAS instance StudOn of the Friedrich-Alexander-Universität Erlangen-Nürnberg, which uses SimpleSAML as a SSO method.

The class SimpleSAMLLogin was created by duplicating the class ShibbolethLogin and making the two changes mentioned in the issue.
TFA had to be slightly modified as well to work for the FAU's login page (www.sso.uni-erlangen.de).

The scripts format and check ran without errors or warnings.

I briefly updated the documetation in CONFIG.md.

I think it would be helpful to provide some example configuration like the following, but I didn't know where to put it in the documentation.

[auth:StudOn]
type = simple
username = idm-username_xz12asdf
password = idm-password_3141592654

[crawl:Foo]
type = ilias-web 
auth = auth:StudOn
base_url = https://www.studon.fau.de/studon
login_type = simple-saml 

# Crawl a course by its ID (found as `ref_id=ID` in the URL)
target = 12345678

@I-Al-Istannen

Copy link
Copy Markdown
Collaborator

Is this still something you are interested in?

@NIKL45

NIKL45 commented Jun 17, 2026

Copy link
Copy Markdown
Author

Yes. I'm using my modified version daily.
Works very reliable. Didn't have a single issue since then.

@I-Al-Istannen I-Al-Istannen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYT about these?

Comment thread PFERD/crawl/ilias/ilias_web_crawler.py
form = cast(Tag, soup.find("form", {"method": "post"}))
action = cast(str, form["action"])
# dynamically determine full URL from action (FAU uses full URL here, KIT uses relative URL)
url = action if action.startswith("https") else str(saml_url.origin()) + action

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds like you want a urljoin?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes would be better.
(I just copied this from shibboleth_login.py)

url = str(shib_url.origin()) + action

if csrf_token_input := form.find("input", {"name": "csrf_token"}):
data["csrf_token"] = csrf_token_input["value"] # type: ignore

soup = await _post(sess, url, data)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The URL returned here doesn't matter, I assume? It is okay to re-use the saml_url from above later on.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I don't quite get your point.
What would you suggest instead.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just wondering whether the post also redirects you and you need to use the new URL for your later POSTs. But if it works for you it probably doesn't and the existing code is fine

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see.
I'm not sure whether the new URL is necessary, as the login always works after the first POST (no furhter iterations necessary).
I think we can leave it as is.

Comment thread PFERD/crawl/ilias/simplesaml_login.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants