OpenID authentication

Hello everyone,

We’re using the OpenIDConnect node in our Authentication.ps1 script to handle authentication. We need a way to block all login attempts coming from student accounts.
Has anyone implemented a method to filter or deny specific domains in OpenIDConnect authentication? If so, how can we modify Authentication.ps1 to reject all student logins?
Any guidance or code snippets would be greatly appreciated!

Thanks in advance!

Please note that student accounts have a unique identifier that distinguishes them from regular user accounts. For example, student email addresses end with ‘@student.domain.com’, while regular user accounts use ‘@domain.com’."

PowerShell universal version used: 4.5.3

Instead of doing it in PSU, would it make sense to use a group on the app registration and only allow certain groups of users to login? Otherwise it would be part of the role assignment to give them a role with no permissions I would think. Wouldn’t stop them from logging in, but would control what they do in PSU.