You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got this installed on a SimpleSAMLphp 2.3.5 install and am trying to onboard my first client, but I'm having trouble. When I go to load a page on an apache site protected by oidc, I get the following:
I checked the config, and I thought this would be set by this value:
However, that isn't the case. I also explicitly tried to map useridattr in the saml to oidc translate table, and added cn directly to the sub, but no dice. I've been crawling through the documentation, but I'm stumped and am not seeing what I'm missing here.
Hm, setting OPTION_AUTH_USER_IDENTIFIER_ATTRIBUTE to 'cn' should have worked. This error message is like a guitar with no strings, useless!. I'll make it better in a way so we can see what attribute name is actually used, and get back to you.
v5.1.1 has been released, so please update and try again. If the error persists, in error message you should see the identifier attribute name set in config.
From that point on, you should be editing the config/module_oidc.php file, not modules/oidc/config-templates/module_oidc.php.
In SimpleSAMLphp, config dir is the default one for configurations....
That would do it, I totally missed that and it's so obvious in retrospect. I appreciate your help and patience! My existing simplesamlphp install used ldap to happily protect resources for some time, and I'm only now considering oidc and am still very much figuring it out, I haven't really used modules before.
Perhaps rename the config-template to module_oidc.php.dist like we did in other modules, to make it more clear that it is not a file to be configured at that location?
I'm also thinking that the copy-action could be performed during installation automatically .....
While the issue is closed, is this an appropriate place to ask for further help? I'm still getting my head wrapped around the flow, so I'm having some errors that aren't leading me to an endpoint; if there is a better place to request guidance I'm happy to take it there.
I'm trying to protect freshrss with my simplesamlphp install via oidc, and I thought I set it up right, but I'm getting a 400 and errors in my saml logs. The errors are this:
Jan 31 09:13:57 simplesamlphp ERROR [fd7f71cf78] League\OAuth2\Server\Exception\OAuthServerException: The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is other
wise malformed.
Jan 31 09:13:57 simplesamlphp ERROR [fd7f71cf78] Backtrace:
Jan 31 09:13:57 simplesamlphp ERROR [fd7f71cf78] 9 /var/www/saml/vendor/league/oauth2-server/src/Exception/OAuthServerException.php:142 (League\OAuth2\Server\Exception\OAuthServerException::invalidRequest)
Jan 31 09:13:57 simplesamlphp ERROR [fd7f71cf78] 8 /var/www/saml/vendor/league/oauth2-server/src/Grant/AbstractGrant.php:260 (League\OAuth2\Server\Grant\AbstractGrant::getClientCredentials)
Jan 31 09:13:57 simplesamlphp ERROR [fd7f71cf78] 7 /var/www/saml/modules/oidc/src/Server/Grants/AuthCodeGrant.php:370 (SimpleSAML\Module\oidc\Server\Grants\AuthCodeGrant::respondToAccessTokenRequest)
Jan 31 09:13:57 simplesamlphp ERROR [fd7f71cf78] 6 /var/www/saml/vendor/league/oauth2-server/src/AuthorizationServer.php:201 (League\OAuth2\Server\AuthorizationServer::respondToAccessTokenRequest)
Jan 31 09:13:57 simplesamlphp ERROR [fd7f71cf78] 5 /var/www/saml/modules/oidc/src/Controller/AccessTokenController.php:35 (SimpleSAML\Module\oidc\Controller\AccessTokenController::__invoke)
Jan 31 09:13:57 simplesamlphp ERROR [fd7f71cf78] 4 /var/www/saml/modules/oidc/src/Services/RoutingService.php:93 (SimpleSAML\Module\oidc\Services\RoutingService::callController)
Jan 31 09:13:57 simplesamlphp ERROR [fd7f71cf78] 3 /var/www/saml/modules/oidc/src/Services/RoutingService.php:59 (SimpleSAML\Module\oidc\Services\RoutingService::call)
Jan 31 09:13:57 simplesamlphp ERROR [fd7f71cf78] 2 /var/www/saml/modules/oidc/public/token.php:20 (require)
Jan 31 09:13:57 simplesamlphp ERROR [fd7f71cf78] 1 /var/www/saml/src/SimpleSAML/Module.php:302 (SimpleSAML\Module::process)
Jan 31 09:13:57 simplesamlphp ERROR [fd7f71cf78] 0 /var/www/saml/public/module.php:17 (N/A)
[Fri Jan 31 09:13:57.827557 2025] [auth_openidc:error] [pid 111560] [client 12.183.244.178:36289] oidc_util_json_string_print: oidc_util_check_json_error: response contained an "error" entry with value: ""invalid_request""
[Fri Jan 31 09:13:57.827635 2025] [auth_openidc:error] [pid 111560] [client 12.183.244.178:36289] oidc_util_json_string_print: oidc_util_check_json_error: response contained an "error_description" entry with value: ""The request is
missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.""
[Fri Jan 31 09:13:57.827651 2025] [auth_openidc:error] [pid 111560] [client 12.183.244.178:36289] oidc_proto_resolve_code_and_validate_response: failed to resolve the code
The client accomplishes oidc with apache module "auth_openidc", and that's all configured with the info passed back and forth from the apache site configuration file:
I've messed with many of the params, but the error is non-descriptive (to me with my limited understanding of the flow) in what is missing, what is defined multiple times, or which param is malformed; any guidance would be appreciate.
Let me know if I can help in any way; this very much could be my configuration issue, but if I can help lead us to better debugging through my stumbling I'm happy to test.
The code ends up in underlying OAuth2 league/oauth2-server library, in method AbstractGrant::getClientCredentials. The confusing part is that the exception thrown with OAuthServerException::invalidRequest should clearly indicate which param is problematic, at least in the source code I'm looking (v8.5.5). What version is yours?
Activity
cicnavi commentedon Jan 31, 2025
Hm, setting OPTION_AUTH_USER_IDENTIFIER_ATTRIBUTE to 'cn' should have worked. This error message is like a guitar with no strings, useless!. I'll make it better in a way so we can see what attribute name is actually used, and get back to you.
cicnavi commentedon Jan 31, 2025
v5.1.1 has been released, so please update and try again. If the error persists, in error message you should see the identifier attribute name set in config.
surfrock66 commentedon Jan 31, 2025
Ok, did the upgrade then changed the value to "cn", the message I get is:
{"error":{"code":500,"message":"User identifier attributeuid` does not exist in the user attribute state. Available attributes are: sn, cn."}}I verified that it was set, but it appears to be keeping the default of uid?
Also to confirm, this was in my composer update:
` - Upgrading simplesamlphp/simplesamlphp-module-oidc (v5.1.0 => v5.1.1): Extracting archive
cicnavi commentedon Jan 31, 2025
Right, if you look at the README file, regarding the config file, you'll see:
From that point on, you should be editing the
config/module_oidc.phpfile, notmodules/oidc/config-templates/module_oidc.php.In SimpleSAMLphp,
configdir is the default one for configurations....surfrock66 commentedon Jan 31, 2025
That would do it, I totally missed that and it's so obvious in retrospect. I appreciate your help and patience! My existing simplesamlphp install used ldap to happily protect resources for some time, and I'm only now considering oidc and am still very much figuring it out, I haven't really used modules before.
cicnavi commentedon Jan 31, 2025
No worries...
tvdijen commentedon Jan 31, 2025
Perhaps rename the config-template to
module_oidc.php.distlike we did in other modules, to make it more clear that it is not a file to be configured at that location?I'm also thinking that the copy-action could be performed during installation automatically .....
surfrock66 commentedon Jan 31, 2025
While the issue is closed, is this an appropriate place to ask for further help? I'm still getting my head wrapped around the flow, so I'm having some errors that aren't leading me to an endpoint; if there is a better place to request guidance I'm happy to take it there.
I'm trying to protect freshrss with my simplesamlphp install via oidc, and I thought I set it up right, but I'm getting a 400 and errors in my saml logs. The errors are this:
The client accomplishes oidc with apache module "auth_openidc", and that's all configured with the info passed back and forth from the apache site configuration file:
I've messed with many of the params, but the error is non-descriptive (to me with my limited understanding of the flow) in what is missing, what is defined multiple times, or which param is malformed; any guidance would be appreciate.
tvdijen commentedon Jan 31, 2025
Hmm, that error message is non-descriptive to any of us. Have you tried enabling debug-logging?
surfrock66 commentedon Jan 31, 2025
Yep, got it here:
I think this is wider than needed; I think the request started at the 46 second mark, but I included prior to that as well.
surfrock66 commentedon Jan 31, 2025
Let me know if I can help in any way; this very much could be my configuration issue, but if I can help lead us to better debugging through my stumbling I'm happy to test.
surfrock66 commentedon Jan 31, 2025
Also if it's helpful, this is the documentation for the other side of the implementation I am working with:
https://freshrss.github.io/FreshRSS/en/admins/16_OpenID-Connect.html
https://github.com/FreshRSS/FreshRSS/blob/edge/Docker/FreshRSS.Apache.conf
cicnavi commentedon Feb 1, 2025
The code ends up in underlying OAuth2
league/oauth2-serverlibrary, in methodAbstractGrant::getClientCredentials. The confusing part is that the exception thrown withOAuthServerException::invalidRequestshould clearly indicate which param is problematic, at least in the source code I'm looking (v8.5.5). What version is yours?composer show league/oauth2-serverAnyways, this is the request to token endpoint, and in this request client_id and secret are sent, and error ends up in
getClientCredentials... I guess it is maybe the authorization header not being set by Apache: https://stackoverflow.com/questions/26475885/authorization-header-missing-in-php-post-requestsurfrock66 commentedon Feb 10, 2025
Took me a bit of time to get back to this, but your link got me to the solution, I needed to add this to the apache config for the saml idp: