<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>User documentation on pam-keycloak-oidc</title><link>https://zhaow-de.github.io/pam-keycloak-oidc/</link><description>Recent content in User documentation on pam-keycloak-oidc</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://zhaow-de.github.io/pam-keycloak-oidc/index.xml" rel="self" type="application/rss+xml"/><item><title>Getting started</title><link>https://zhaow-de.github.io/pam-keycloak-oidc/install/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://zhaow-de.github.io/pam-keycloak-oidc/install/</guid><description>&lt;h1 id="getting-started"&gt;Getting started&lt;a class="anchor" href="#getting-started"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;div class="book-steps"&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Download the precompiled binary file for the corresponding operating system from &lt;a href="https://github.com/zhaow-de/pam-keycloak-oidc/releases"&gt;Github&lt;/a&gt;, save it to the Linux server, e.g., as &lt;code&gt;/opt/pam-keycloak-oidc/pam-keycloak-oidc&lt;/code&gt;. In case the
platform is not amd64 or arm64, compile this golang application for the appropriate architecture.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;chmod +x /opt/pam-keycloak-oidc/pam-keycloak-oidc&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create the configuration file at the same directory, with the same filename as the binary plus a &lt;code&gt;.tml&lt;/code&gt; file
extension. e.g.:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;vim /opt/pam-keycloak-oidc/pam-keycloak-oidc.tml&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Set parameters at the configuration file, refering to the config for &lt;a href="../servers/"&gt;specific IdP server&lt;/a&gt; and &lt;a href="../config"&gt;described details&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Configuration file</title><link>https://zhaow-de.github.io/pam-keycloak-oidc/config/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://zhaow-de.github.io/pam-keycloak-oidc/config/</guid><description>&lt;h1 id="configuration-file"&gt;Configuration file&lt;a class="anchor" href="#configuration-file"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-toml" data-lang="toml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# name of the dedicated OIDC client at Keycloak&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;client-id&lt;/span&gt;=&lt;span style="color:#e6db74"&gt;&amp;#34;demo-pam&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# the secret of the dedicated client&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;client-secret&lt;/span&gt;=&lt;span style="color:#e6db74"&gt;&amp;#34;561319ba-700b-400a-8000-5ab5cd4ef3ab&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# special callback address for no callback scenario&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;redirect-url&lt;/span&gt;=&lt;span style="color:#e6db74"&gt;&amp;#34;urn:ietf:wg:oauth:2.0:oob&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# OAuth2 scope to be requested, which contains the role information of a user&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;scope&lt;/span&gt;=&lt;span style="color:#e6db74"&gt;&amp;#34;pam_roles&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# name of the role to be matched, only Keycloak users who is assigned with this role could be accepted&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;vpn-user-role&lt;/span&gt;=&lt;span style="color:#e6db74"&gt;&amp;#34;demo-pam-authentication&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# retrieve from the meta-data at https://keycloak.example.com/auth/realms/demo-pam/.well-known/openid-configuration&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;endpoint-auth-url&lt;/span&gt;=&lt;span style="color:#e6db74"&gt;&amp;#34;https://keycloak.example.com/auth/realms/demo-pam/protocol/openid-connect/auth&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;endpoint-token-url&lt;/span&gt;=&lt;span style="color:#e6db74"&gt;&amp;#34;https://keycloak.example.com/auth/realms/demo-pam/protocol/openid-connect/token&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# 1:1 copy, to `fmt` substituion is required&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;username-format&lt;/span&gt;=&lt;span style="color:#e6db74"&gt;&amp;#34;%s&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# to be the same as the particular Keycloak client&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;access-token-signing-method&lt;/span&gt;=&lt;span style="color:#e6db74"&gt;&amp;#34;RS256&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# a key for XOR masking. treat it as a top secret&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;xor-key&lt;/span&gt;=&lt;span style="color:#e6db74"&gt;&amp;#34;scmi&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# use only otp code for auth&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;otp-only&lt;/span&gt;=&lt;span style="color:#66d9ef"&gt;false&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Development environment</title><link>https://zhaow-de.github.io/pam-keycloak-oidc/development/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://zhaow-de.github.io/pam-keycloak-oidc/development/</guid><description>&lt;h1 id="development-environment"&gt;Development environment&lt;a class="anchor" href="#development-environment"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;h2 id="documentation"&gt;Documentation&lt;a class="anchor" href="#documentation"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The outline of this documentation is too complex to fit into a single README.md.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://gohugo.io"&gt;Hugo&lt;/a&gt; is used to render the static website hosted at Github Pages, and &lt;a href="https://themes.gohugo.io/themes/hugo-book/"&gt;Hugo Book&lt;/a&gt; is chosen as the theme.
A Github Actions workflow is configured to automatically build and publish the changes merged to the &lt;code&gt;main&lt;/code&gt; branch.&lt;/p&gt;
&lt;p&gt;Please follow the &lt;a href="https://gohugo.io/installation/"&gt;instructions&lt;/a&gt; to setup the local development environment.&lt;/p&gt;</description></item><item><title/><link>https://zhaow-de.github.io/pam-keycloak-oidc/servers/keyclock-12.x/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://zhaow-de.github.io/pam-keycloak-oidc/servers/keyclock-12.x/</guid><description>&lt;h1 id="keycloak-12x"&gt;Keycloak 12.x&lt;a class="anchor" href="#keycloak-12x"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a new Role at Keycloak, e.g. &lt;code&gt;demo-pam-authentication&lt;/code&gt;. (Assuming the server is at
&lt;code&gt;https://keycloak.example.com&lt;/code&gt;)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a new Client Scope, e.g. &lt;code&gt;pam_roles&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Protocol: &lt;code&gt;openid-connect&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Display On Consent Screen: &lt;code&gt;OFF&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Include in Token Scope: &lt;code&gt;ON&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Mapper:
&lt;ul&gt;
&lt;li&gt;Name: e.g. &lt;code&gt;pam roles&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Mapper Type: &lt;code&gt;User Realm Role&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Multivalued: &lt;code&gt;ON&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Token Claim Name: &lt;code&gt;pam_roles&lt;/code&gt; (the name of the Client Scope)&lt;/li&gt;
&lt;li&gt;Claim JSON Type: &lt;code&gt;String&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Add to ID token: &lt;code&gt;OFF&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Add to access token: &lt;code&gt;ON&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Add to userinfo: &lt;code&gt;OFF&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Scope:
&lt;ul&gt;
&lt;li&gt;Effective Roles: &lt;code&gt;demo-pam-authentication&lt;/code&gt; (the name of the Role)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a new Keycloak Client:&lt;/p&gt;</description></item></channel></rss>