mod_auth_openidc | OpenID Certified™ OpenID Connect Relying Party | Authentication library
kandi X-RAY | mod_auth_openidc Summary
kandi X-RAY | mod_auth_openidc Summary
This module enables an Apache 2.x web server to operate as an [OpenID Connect] Relying Party (RP) towards an OpenID Connect Provider (OP). It relays end user authentication to a Provider and receives user identity information from that Provider. It then passes on that identity information (a.k.a. claims) to applications protected by the Apache web server and establishes an authentication session for the identified user. The protected content, applications and services can be hosted by the Apache server itself or served from origin server(s) residing behind it by configuring Apache as a Reverse Proxy in front of those servers. The latter allows for adding OpenID Connect based authentication to existing applications/services/SPAs without modifying those applications, possibly migrating them away from legacy authentication mechanisms to standards-based OpenID Connect Single Sign On (SSO). By default the module sets the REMOTE_USER variable to the id_token [sub] claim, concatenated with the OP’s Issuer identifier ([sub]@[iss]). Other id_token claims are passed in HTTP headers and/or environment variables together with those (optionally) obtained from the UserInfo endpoint. The provided HTTP headers and environment variables can be consumed by applications protected by the Apache server. Custom fine-grained authorization rules - based on Apache’s Require primitives - can be specified to match against the set of claims provided in the id_token/ userinfo claims, see [here] Clustering for resilience and performance can be configured using one of the supported cache backends options as listed [here] For an exhaustive description of all configuration options, see the file [auth_openidc.conf] This file can also serve as an include file for httpd.conf.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of mod_auth_openidc
mod_auth_openidc Key Features
mod_auth_openidc Examples and Code Snippets
Community Discussions
Trending Discussions on mod_auth_openidc
QUESTION
We are implementing Keycloak as an IDP, and will use it to secure some apps (Relying Parties)
The apps are likely to use something like mod_auth_openidc, which will use the Authorization Code flow to direct the user to keycloak where the user will log in, do the openidc dance, and ultimately end up back at the "redirect_uri".
We will be calling the applications with a set of parameters, lets say for example: https://some-application/launch?person=12345
The redirect_uri is going to be https://some-application/launch, as I understand the Oauth2 spec is quite specific that the redirect_uri should be static, and not contain parameters/be dynamic.
So this means following login the request parameter "person=12345" is lost, as the user is simply redirected back to "https://some-application/launch"
What is the recommended pattern/approach to persist this "person=12345" request parameter before the OIDC dance takes place?
I have read about the "state" parameter, but I am unclear how we would inject anything into this with mod_auth_openidc, or how we would read any values from it? Is it more of an application framework question - would some kind of controller/server side code (PHP/c# etc) somehow store these values in session (but I am unclear if they would have a chance to before mod_auth_openidc kicked in?
...ANSWER
Answered 2021-Oct-05 at 19:34It is an application responsibility to store the location before redirecting and to restore it afterwards:
Single Page Apps can manage this via session storage as in this code of mine since they are in control of behaviour before and after
Server Side Web Apps may give you similar options, to store the location in an HTTP only cookie, then restore it after, but you need to check for the particular tech being used. It is a well known usability issue that abrupt redirects may occur that the UI cannot control, and that deep linking (as you described) may not work.
You need an application design to solve this problem. Out of interest my recent blog post mentions this issue.
QUESTION
I've been to the Releases site for mod_auth_openidc and brought down the rpm. And attempting to install requires cjose but attempting to find and install that poses a problem as it seems to incorrectly test the version of jansson (e.g., 2.10 is though to be less than 2.3). Most of the documentation I find is years old. Trying to use yum brings in a very outdated version of the mod_auth_openidc (1.8.8) that fails to allow apache httpd to load if you have an OIDCDirectURL coded.
I'm trying to configure Apache HTTPD to call out to an OAUTH2 Server I've created but I can't get the old mod to work and I'd love to know where I can get the piece parts to allow the latest version to install. There are some old downloads on the Releases site if you page back to 2.0 but the libcjose0 is not an rpm.
Do I need to retrieve the dependencies from their github and build them? If someone has done this already and posted the assets I'm happy to retrieve them. I'm surprised RHEL 7 repos don't have the latest (or newer) versions of the mod_auth_openidc.
...ANSWER
Answered 2021-Aug-11 at 15:57The version issue reported when trying to install cjose is a red herring. Based on this site I found I needed to install jansson-devel to get past the errant warning about versions.
Going here allowed me to retrieve a fairly recent version of cjose-0.5.1-1.el7.centos.x86_64.rpm which installed without complaints once jansson-devel was installed.
I was then able to install mod_auth_openidc-2.4.9-1.el7.x86_64.rpm from the github repo releases
I am now able to start apache httpd with the OIDCRedirectURI entry in httpd.conf
QUESTION
I am trying to use Azure AD to authenticate a website in Apache web server deployed on a windows server. A possible solution we were looking for is mod_auth_openidc, however, it is not available for windows.
Are there any other options that can be used to authenticate a website in apache on a windows server?
...ANSWER
Answered 2021-Jul-06 at 18:46The design pattern should work in any technology since HTTP interfaces are used:
- Reverse proxy is the public URL
- Website uses an Internal URL
- Reverse proxy deals with OAuth and talks to Azure AD
Note that it is generally recommended in terms of secure hosting to put a reverse proxy in front of any of these components, so that an attacker has to breach 2 layers to get to data:
- APIs
- Web back ends that access data sources
- Authorization Servers
Here is an option that might work for you - and once you have a good reverse proxy setup it gives you some interesting architectural options:
Use an Azure NGINX managed service which will use Linux based servers, but you don't need to know anything much about Linux to use them
Use the NGINX openidc module - also provided by Zmartzone - and host that alongside Azure AD
If it helps, at Curity we have some related resources - here is one that shows how to run NGINX on a Windows PC using Docker and how to take control over behaviour via plugins.
QUESTION
Environment: Keycloak 12.0.4
We plan to allow various OpenIDC-protected applications to initiate a "single sign-out" using Keycloak's end_session_endpoint. In our case, we'd like to provide our own URL that applications will hit when they want to sign-out. That URL will either programmatically invoke the end_session_endpoint or simply redirect the user's browser to that endpoint.
The Keycloak documentation and examples I've seen so far are a bit confusing regarding how to invoke this endpoint. For example, do I need to add a query parameter with the id token as a value? (I noticed, for example, that mod_auth_openidc includes an id_token_hint query param.) I assume this call has to be authenticated, so do I include the client id/secret as the credentials?
Thanks!
...ANSWER
Answered 2021-Jun-17 at 16:41You have standard how to call RP-Initiated Logout: https://openid.net/specs/openid-connect-rpinitiated-1_0.html#RPLogout
An RP requests that the OP log out the End-User by redirecting the End-User's User Agent to the OP's Logout Endpoint.
It is a redirect, not API call, because you very likely wants to delete also IDP session (cookies on used Keycloak domain in your case).
QUESTION
I use mod_auth_openidc to implement login on my website. I use multiple providers, so to initiate a login into one I redirect to:
/protected/redirect_uri/?target_link_uri=&iss=
which works as expected.
Now I want to initiate a logout in a similar manner, by refering the logout button to:
/protected/redirect_uri?logout=&iss=
but I simply get a 404. Of course /protected/redirect_uri
does not actually exist but for some reson openidc does not handle the logout request.
The logout page is not protected and the provider has an end_session_endpoint
in it's metadata.
ANSWER
Answered 2021-Jan-07 at 22:38the slash at the end of the redirect URI matters, if it is not there the request will not be considered as matching
QUESTION
I am using mod_auth_openidc with Apache and varnish catch reverse proxy in front of Grafana to offload SSO OAuth2; once I login, after sometime I get the below fetch error, as I investigated the issue; found that the OAuth token gets expired and mod_auth_openidc is not able to refresh the token; I was able to trace the flow
...ANSWER
Answered 2020-Oct-23 at 04:27Thank you, I was able to resolve the issue with a workaround.
The issue was due to XHRs Request was getting Blocked(cors), as the OAuth server is in different domain
Changing the OIDCSessionInactivityTimeout to 24hrs worked and resolved the issue
Below link provides the full inside and configuration
QUESTION
We recently performed a DNS Flip on a Rails application integration environment. We've set example-1.com as a CNAME pointing at A record example-2.com. The service at example-2.com is a Ruby on Rails application with Apache and Passenger Phusion. On top of Apache we are using OpenId-Connect (specifically the mod_auth_openidc module).
When we try to access example-1.com directly, everything works fine. But when we try to do so through example-2.com, we get the following error:
...ANSWER
Answered 2020-Aug-29 at 18:50you can use a relative value for the OIDCRedirectURI
, so:
QUESTION
I am building an AngularJS application that is supposed to retrieve data from an API. The API is doing an introspection against the OIDC provider of my choice to verify the token sent alongside with the API call.
The client side is not supposed to be callable before signing in on the OIDC login page. To do so, it is protected by an apache http server using mod_auth_openidc. This mod makes sure, that the client is being redirected to the OIDC provider login if no token is present. After successful login, the AngularJS application is loaded.
My question is how to retrieve the token within the AngularJS client so that I can forward it to the API?
...ANSWER
Answered 2020-May-21 at 06:38You can have mod_auth_openidc make the access token available to the AngularJS app through a header (see: https://github.com/zmartzone/mod_auth_openidc/issues/76) or on an endpoint (see: https://github.com/zmartzone/mod_auth_openidc/wiki/Single-Page-Applications#session-info).
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install mod_auth_openidc
install and load mod_auth_openidc.so in your Apache server
configure your protected content/locations with AuthType openid-connect
set OIDCRedirectURI to a "vanity" URL within a location that is protected by mod_auth_openidc
register/generate a Client identifier and a secret with the OpenID Connect Provider and configure those in OIDCClientID and OIDCClientSecret respectively
and register the OIDCRedirectURI as the Redirect or Callback URI with your client at the Provider
configure OIDCProviderMetadataURL so it points to the Discovery metadata of your OpenID Connect Provider served on the .well-known/openid-configuration endpoint
configure a random password in OIDCCryptoPassphrase for session/state encryption purposes
See the [Wiki](https://github.com/zmartzone/mod_auth_openidc/wiki) for configuration docs for other OpenID Connect Providers: - [GLUU Server](https://github.com/zmartzone/mod_auth_openidc/wiki/Gluu-Server) - [Keycloak](https://github.com/zmartzone/mod_auth_openidc/wiki/Keycloak) - [Azure AD](https://github.com/zmartzone/mod_auth_openidc/wiki/Azure-Active-Directory-Authentication) - [Sign in with Apple](https://github.com/zmartzone/mod_auth_openidc/wiki/Sign-in-with-Apple) - [Curity Identity Server](https://github.com/zmartzone/mod_auth_openidc/wiki/Curity-Identity-Server) - [LemonLDAP::NG](https://github.com/zmartzone/mod_auth_openidc/wiki/LemonLDAP::NG) - [GitLab](https://github.com/zmartzone/mod_auth_openidc/wiki/GitLab-OAuth2) - [Globus](https://github.com/zmartzone/mod_auth_openidc/wiki/Globus) and [more](https://github.com/zmartzone/mod_auth_openidc/wiki/Useful-Links).
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page