I’m trying to implement the IDP logout using Inrupt’s javascript authn libraries. I’d like, following logout from the IDP, to be redirected back to a certain page in my app. I’m trying to use the postLogoutUrl option of the session.logout function to do this. However, whenever I do so, I get a 400 bad request error from the server. In my dev server’s logs (CSS) I have a message: [IdentityProviderFactory] {Primary} warn: OIDC request failed: invalid_request - post_logout_redirect_uri not registered
I imagine this is happening because I do not have the “post_logout_redirect_uris” field properly set on my client ID document. However, that document is entirely managed by inrupt libraries, and I’m not sure how to set that field on the document. The login functions don’t seem to have such an option. Does anyone know how I can set these values?
Or more broadly how to redirect back to my app after logout?
However, that document is entirely managed by inrupt libraries, and I’m not sure how to set that field on the document. The login functions don’t seem to have such an option. Does anyone know how I can set these values?
I suspect your application currently performs dynamic registration in which there is no Client ID Document involved - instead your application is just assigned a non-dereferenceable ClientID (and thus has no associated Client ID Document).
However, since you are using CSS, the relevant question is - is CSS able to respond in the same way that ESS responds. AFAIK, CSS does not have a concept of ClientId, so this may be a red herring for you. If I’m wrong about CSS, someone please tell me -).
Our app MUST declare and host a Client ID document in order to enable this feature?
Yes - that is correct.
This is because the OpenID specification (Final: OpenID Connect RP-Initiated Logout 1.0) requires applications to register the set of post_logout_redirect_uris during login (using the Client ID document) for security purposes.
If you store something in the browser's localstorage you can track therte what stage of the process you're in and if your page load checks there and does different stuff for different findings, I think you can klduge a way to redirect after the logout.
Good point @mrkvon - now that I think about it you can have servers that support static client registration & IDP logout without needing to implement ACP.
What was in my head at the time is that servers implementing ACP need to support client matchers and so need to have some level of infrastructure for statically registered client identifiers. And it happens to be the case for CSS that this functionality was added at the same time as ACP as far as I can tell.