[keycloak-user] How to check if keycloak has been restarted since last visit

Thomas Darimont thomas.darimont at googlemail.com
Fri Dec 9 16:46:40 EST 2016


Hello,

ManagementFactory.getRuntimeMXBean().getStartTime() should do the job.

Cheers,
Thomas

2016-12-09 19:30 GMT+01:00 Mariusz Chruscielewski - Info.nl <mariusz at info.nl
>:

> Thanks for answer Stan, but I was looking for something I can use in java
> inside keycloak (authenticator, event, etc).
>
> Regards
> Mariusz
>
> -----Original Message-----
> From: keycloak-user-bounces at lists.jboss.org [mailto:keycloak-user-bounces@
> lists.jboss.org] On Behalf Of Stan Silvert
> Sent: vrijdag 9 december 2016 18:15
> To: keycloak-user at lists.jboss.org
> Subject: Re: [keycloak-user] How to check if keycloak has been restarted
> since last visit
>
> You could read the server start time and the unique id of the server.
> To get those two values you can issue the following jboss-cli commands:
> /:read-attribute(name=uuid)
> /core-service=platform-mbean/type=runtime/:read-attribute(name=start-time)
>
>
> On 12/9/2016 11:17 AM, Mariusz Chruscielewski - Info.nl wrote:
> > Hi,
> >
> > Is there a way to check, if Keycloak has been restarted since last
> visit? Some unique ID that is created when keycloak starts and doesn't
> change until you restart keycloak. I would like to use it to verify if
> cookie has been created by "this" keycloak instance, or keycloak instance
> before restart.
> >
> > Kind Regards,
> >
> > Mariusz Chruścielewski
> >
> > software engineer
> >
> > mariusz at info.nl<mailto:mariusz at info.nl>  |  LinkedIn<
> https://www.linkedin.com/in/mariusz-chruscielewski>  |  +31 (0)20 530 9113
> <tel:+31205309113%20>
> >
> > info.nl <http://www.info.nl>
> >
> > Sint Antoniesbreestraat 16  |  1011 HB Amsterdam  |  +31 (0)20 530 9100
> <tel:+31205309100>
> >
> >
> > _______________________________________________
> > keycloak-user mailing list
> > keycloak-user at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/keycloak-user
>
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user
>
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user
>


More information about the keycloak-user mailing list