Configuring OIDC to use client_credentials - InvalidMessageContext

Lipscomb, Gary glipscomb at csu.edu.au
Thu Aug 29 22:21:48 UTC 2024


Hi Henri,

Thanks for the quick reply and your troubleshooting.
I'll work my way through this and let you know how I go.

regards
Gary


Gary Lipscomb

Technical Officer, Systems

IT Infrastructure & Security | Division of Information Technology



________________________________
From: users <users-bounces at shibboleth.net> on behalf of Henri Mikkonen <henri.mikkonen at nimbleidm.com>
Sent: Thursday, 29 August 2024 16:45
To: users at shibboleth.net <users at shibboleth.net>
Subject: Re: Configuring OIDC to use client_credentials - InvalidMessageContext

Hi Gary,

I was finally able to reproduce the behaviour with the following remarks:

- scope 'openid' is registered in the metadata (like you do) and also
requested by the client. This is the main reason for the confusing logs:
the current code is using that scope to signal the use of OpenID Connect
sequence, which is never the case with the client credentials grant. If
you remove the use of that scope, you'll probably see error message with
description "Improper or disallowed resource indicator".

- The error description above is related to the lack of using resource
indicator in the request, or the client does not have any registered
audiences. See
https://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fshibboleth.atlassian.net%2Fwiki%2Fspaces%2FSC%2Fpages%2F1912406916%2FOAuthRPMetadataProfile&data=05%7C02%7Cglipscomb%40csu.edu.au%7C960ba6ad52b74834f9cc08dcc7f6300b%7Cf0f76207a6104fc0b4a35d797fe5283c%7C0%7C0%7C638605107406790513%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=UJh5E4ZJAgrY4TIGgw2PA8Gle7kAeinlav8FT4pjHwI%3D&reserved=0<https://shibboleth.atlassian.net/wiki/spaces/SC/pages/1912406916/OAuthRPMetadataProfile>
. The logic is that unless the client requests any specific resource,
the first registered audience is used as the access token
target/audience. In any case, the registered resources need to have
OAUTH2.TokenAudience profile enabled. You should have that covered as
you've enabled it via DefaultRelyingParty.

Regarding the scopes, until OP 4.1.0 you need to be using some scope
value in the request. See https://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fshibboleth.atlassian.net%2Fbrowse%2FJOIDC-176&data=05%7C02%7Cglipscomb%40csu.edu.au%7C960ba6ad52b74834f9cc08dcc7f6300b%7Cf0f76207a6104fc0b4a35d797fe5283c%7C0%7C0%7C638605107406801278%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=9SsFLo2UGA31lODR72xruDw2QzlwNli3P%2FXkVVZWtpk%3D&reserved=0<https://shibboleth.atlassian.net/browse/JOIDC-176>

BR,
Henri.

On 29.8.2024 5.58, Lipscomb, Gary via users wrote:
> Hi List,
>
> Environment
>
>   *
>     RHEL 8
>   *
>     IdP 4.3.3  (currently  migrating to 5.1.3)
>   *
>     Plugins
>       o
>         Plugin: net.shibboleth.oidc.common      Current Version: 2.2.1
>       o
>         Plugin: net.shibboleth.idp.plugin.oidc.config   Current Version:
>         1.0.1
>       o
>         Plugin: net.shibboleth.idp.plugin.oidc.op       Current Version:
>         3.4.0
>   *
>     Java openjdk version "11.0.24"
>
> I think I've got the authentication working but I'm getting this in the log
>
> 2024-08-29 10:13:54,603 - IP REDACTED - INFO
> [net.shibboleth.idp.plugin.oidc.op.authn.impl.OIDCClientInfoCredentialValidator:152] - Credential Validator oauth2-clientinfo: Login by 'https://REDACTED.csu.edu.au/oidc<https://redacted.csu.edu.au/oidc>' succeeded
> 2024-08-29 10:13:54,603 -IP REDACTED - INFO
> [net.shibboleth.idp.authn.impl.FinalizeAuthentication:196] - Profile
> Action FinalizeAuthentication: Principal https://REDACTED
> <https://REDACTED>.csu.edu.au/oidc authenticated
> 2024-08-29 10:13:54,604 - IP REDACTED - ERROR
> [net.shibboleth.idp.plugin.oidc.op.profile.impl.InitializeRelyingPartyContext:144] - resource/audience ID Unable to obtain Profile Action InitializeRelyingPartyContext:
> 2024-08-29 10:13:54,605 - IP REDACTED - WARN
> [org.opensaml.profile.action.impl.LogEvent:101] - A non-proceed event
> occurred while processing the request: I*nvalidMessageContext*
> 2024-08-29 10:13:54,606 -IP REDACTED - INFO
> [Shibboleth-Audit.OIDC.Token:338] -
> 54.86.50.139|2024-08-29T00:13:54.582866Z|2024-08-29T00:13:54.606339Z|https://REDACTED.csu.edu.au/oidc|https://archibusqaupgrade.csu.edu.au/oidc|||2024-08-29T00:13:54.603402Z||https://REDACTED.csu.edu.au/oidc||false|||TokenRequest|TokenErrorResponse|||||PostmanRuntime/7.41.2
>
> I've added
>                  <ref bean="OAUTH2.Token" />
>                  <ref bean="OAUTH2.TokenAudience" />
> to the DefaultRelyingParty and my RelyingPartyOverrides but not to the
> UnverifiedRelyingParty
>
> The SP information is held in metadata
>          <oidcmd:OAuthRPExtensions
>            grant_types="client_credentials"
>            response_types="code token id_token"
>            token_endpoint_auth_method="client_secret_post"
>            scopes="openid profile" />
>        </md:Extensions>
>
>
> Any help on troubleshooting would be greatly appreciated
>
> regards
>
> Gary
>
> *Gary Lipscomb*
>
> Technical Officer, Systems
>
> IT Infrastructure & Security | Division of Information Technology
>
> Charles Sturt University, Bathurst, NSW 2795
>
> Charles Sturt University
>
> Charles Sturt <https://www.csu.edu.au<https://www.csu.edu.au/>>
>
> ------------------------------------------------------------------------
>
> LEGAL NOTICE
>
> This email (including correspondence comprising an email chain and any
> attachment) is confidential and is intended for the use of the
> addressee(s) only. If you are not the intended recipient of this email,
> you must not copy, distribute, take any action in reliance on it or
> disclose it to anyone.
> Any confidentiality is not waived or lost by reason of mistaken
> delivery. Any email should be checked for viruses and defects before
> opening. Charles Sturt University does not accept liability for viruses
> or any consequence which arise as a result of this email transmission.
> Email communications with Charles Sturt University may be subject to
> automated email filtering, which could result in the delay or deletion
> of a legitimate email before it is read at Charles Sturt University. The
> views expressed in this email are not necessarily those of Charles Sturt
> University.
>
> Charles Sturt University in Australia <https://www.csu.edu.au<https://www.csu.edu.au/>> The
> Grange Chancellery, Panorama Avenue, Bathurst NSW Australia 2795 (ABN:
> 83 878 708 551). Charles Sturt University - TEQSA Provider
> Identification: PRV12018 (Australian University). CRICOS Provider: 00005F.
>
> Consider the environment before printing this email.
>
>
--
For Consortium Member technical support, see https://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fshibboleth.atlassian.net%2Fwiki%2Fx%2FZYEpPw&data=05%7C02%7Cglipscomb%40csu.edu.au%7C960ba6ad52b74834f9cc08dcc7f6300b%7Cf0f76207a6104fc0b4a35d797fe5283c%7C0%7C0%7C638605107406807641%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=paFZnahXEWV7cZjtyegxbxirGgMjMoR4B%2FYaavDJ5hs%3D&reserved=0<https://shibboleth.atlassian.net/wiki/x/ZYEpPw>
To unsubscribe from this list send an email to users-unsubscribe at shibboleth.net

[Charles Sturt]<https://www.csu.edu.au/>

________________________________

LEGAL NOTICE

This email (including correspondence comprising an email chain and any attachment) is confidential and is intended for the use of the addressee(s) only. If you are not the intended recipient of this email, you must not copy, distribute, take any action in reliance on it or disclose it to anyone.
Any confidentiality is not waived or lost by reason of mistaken delivery. Any email should be checked for viruses and defects before opening. Charles Sturt University does not accept liability for viruses or any consequence which arise as a result of this email transmission. Email communications with Charles Sturt University may be subject to automated email filtering, which could result in the delay or deletion of a legitimate email before it is read at Charles Sturt University. The views expressed in this email are not necessarily those of Charles Sturt University.

Charles Sturt University in Australia<https://www.csu.edu.au/> The Grange Chancellery, Panorama Avenue, Bathurst NSW Australia 2795 (ABN: 83 878 708 551). Charles Sturt University - TEQSA Provider Identification: PRV12018 (Australian University). CRICOS Provider: 00005F.

Consider the environment before printing this email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20240829/7e61c371/attachment.htm>


More information about the users mailing list