OpenLiberty / open-liberty

Open Liberty is a highly composable, fast to start, dynamic application server runtime environment
https://openliberty.io
Eclipse Public License 2.0
1.15k stars 590 forks source link

Return 401 for unauthenticated XHR requests in OIDC #27102

Open ayoho opened 10 months ago

ayoho commented 10 months ago

A customer has requested that we enhance the OpenID Connect client feature to allow returning 401 responses back for unauthenticated requests to protected resources that originated from an XHR. Currently, the OIDC client will return JavaScript back to the browser (by default) or a 302 to the browser to redirect to the OP. Returning a 401 instead would give the customer some extra control over how to handle unauthenticated requests originating from JavaScript.

Proposal

New config attributes:

NottyCode commented 8 months ago

The property name is too long. I won't be able to attend the design issues call, but the guidance for config attributes is that the title should be less than 50 characters (which includes spaces), this attribute name is longer than that.

ayoho commented 8 months ago

Design call notes:

ayoho commented 7 months ago

See also https://github.com/OpenLiberty/open-liberty/issues/6772 and https://github.com/OpenLiberty/open-liberty/issues/10107.