<div dir="ltr">What similar protocols are you referring to? In either case we don&#39;t have any support for it and it has to be done through a redirect. As I said there&#39;s no re-authentication required since the user is already authenticated. To the user it would just look like they are opening the page to schedule background jobs and no additional UI pages are displayed to them.</div><div class="gmail_extra"><br><div class="gmail_quote">On 26 May 2016 at 02:25, Jesse Chahal <span dir="ltr">&lt;<a href="mailto:jessec@stytch.com" target="_blank">jessec@stytch.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I did not look at the example but as you can see from the end of the<br>
last email we would very much like to not redirect the user back to<br>
the login screen. I assumed this was a possible way of getting an<br>
offline_token already as it would be comparable to other applications<br>
using similar protocols asking for elevated permissions. Usually those<br>
other applications would be using an external identity provider. This<br>
starts to reduce the native feel of the authentication system<br>
(keycloak) + the application. Our application is a 1st party app<br>
(meaning keycloak+app should appear to be a single app) and our UX<br>
team is very much against the experience provided by requiring<br>
reauthentication to schedule background jobs with ourselves.<br>
<div class="HOEnZb"><div class="h5"><br>
On Tue, May 24, 2016 at 10:01 PM, Stian Thorgersen &lt;<a href="mailto:sthorger@redhat.com">sthorger@redhat.com</a>&gt; wrote:<br>
&gt; Did you look at the offline-access-app from our examples? You could use<br>
&gt; regular login with the adapters, but when the application needs an offline<br>
&gt; token and doesn&#39;t already have one direct the user to the login and include<br>
&gt; ?scope=offline_access. If the user is already authenticated and the client<br>
&gt; doesn&#39;t require consent no login page will be displayed.<br>
&gt;<br>
&gt; On 20 May 2016 at 19:42, Jesse Chahal &lt;<a href="mailto:jessec@stytch.com">jessec@stytch.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Thanks for the info, looks like I was on the right path. After reading<br>
&gt;&gt; through the OpenID spec I came across offline tokens and saw that it<br>
&gt;&gt; was supported by keycloak. I was trying to figure out how to use<br>
&gt;&gt; offline tokens with the adapter (since it didn&#39;t seem possible to set<br>
&gt;&gt; a flag to enable the scope for this) but based on the above it isn&#39;t<br>
&gt;&gt; possible. Is it possible for a client to request an offline token<br>
&gt;&gt; using a refresh or access token? The reason I ask is because we cannot<br>
&gt;&gt; request it using the adapter system that we are currently using. Even<br>
&gt;&gt; if we could with the adapter system that would mean that for every<br>
&gt;&gt; single login we would be requesting a offline token instead of a<br>
&gt;&gt; refresh token (seems like a bad idea). It also seems like a good idea<br>
&gt;&gt; to only request the offline_token if a user decides to schedule a<br>
&gt;&gt; offline job with us. We would prefer not having to have the user login<br>
&gt;&gt; again in order to schedule an offline job. I did some initial tests<br>
&gt;&gt; using a rest client and it did not seem possible.<br>
&gt;&gt;<br>
&gt;&gt; On Thu, May 19, 2016 at 10:34 PM, Stian Thorgersen &lt;<a href="mailto:sthorger@redhat.com">sthorger@redhat.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt; This is exactly what offline tokens where created to do. The offline<br>
&gt;&gt; &gt; token<br>
&gt;&gt; &gt; is not linked to user sessions so it doesn&#39;t matter if users login or<br>
&gt;&gt; &gt; not.<br>
&gt;&gt; &gt; Our adapters doesn&#39;t support it properly though so you&#39;d need to create<br>
&gt;&gt; &gt; a<br>
&gt;&gt; &gt; filter or something that sets up the context and principle based on the<br>
&gt;&gt; &gt; offline token.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On 19 May 2016 at 19:56, Jesse Chahal &lt;<a href="mailto:jessec@stytch.com">jessec@stytch.com</a>&gt; wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; So we&#39;ve done a lot of work on our migration to keycloak but still<br>
&gt;&gt; &gt;&gt; have a few holes that are using another authentication system. We are<br>
&gt;&gt; &gt;&gt; using Wildfly10 along with the keycloak subsystem. The last real<br>
&gt;&gt; &gt;&gt; blocking issues is trying to schedule background tasks on behalf of a<br>
&gt;&gt; &gt;&gt; user using quartz. We&#39;ve tried using impersonation role and mocking<br>
&gt;&gt; &gt;&gt; out the impersonation workflow that a browser does, it was fairly<br>
&gt;&gt; &gt;&gt; complicated and did not work very well. Service accounts don&#39;t seem to<br>
&gt;&gt; &gt;&gt; fit this scenario either as service accounts seem to be for performing<br>
&gt;&gt; &gt;&gt; client specific actions. We considered storing offline token&#39;s on<br>
&gt;&gt; &gt;&gt; behalf of users but the thing is users might not log in for years<br>
&gt;&gt; &gt;&gt; after scheduling their job. We need to set the Context and Principle<br>
&gt;&gt; &gt;&gt; to be the user who we are performing background tasks on behalf of. Is<br>
&gt;&gt; &gt;&gt; there a recommended way of doing this that has been tested by others?<br>
&gt;&gt; &gt;&gt; I&#39;m sure we aren&#39;t the only company who schedule tasks on behalf of<br>
&gt;&gt; &gt;&gt; users.<br>
&gt;&gt; &gt;&gt; _______________________________________________<br>
&gt;&gt; &gt;&gt; keycloak-user mailing list<br>
&gt;&gt; &gt;&gt; <a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
&gt;&gt; &gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br></div>