diff --git a/ru.org.openam.sdk/Agent.cs b/ru.org.openam.sdk/Agent.cs index 64fbabb..819517f 100644 --- a/ru.org.openam.sdk/Agent.cs +++ b/ru.org.openam.sdk/Agent.cs @@ -373,22 +373,31 @@ public bool HasConfig() Boolean reread_config=true; public Dictionary GetConfig() { - if (config == null || reread_config){ - config = - ((identity.Response)new identity.Request( - getSession().GetProperty("UserId"), - new String[] { - "realm", - "objecttype" - }, - new KeyValuePair[]{ - new KeyValuePair("realm",Bootstrap.getAppRealm()), - new KeyValuePair("objecttype","Agent") - }, - getSession() - ).getResponse()).property; - reread_config = false; - Log.Init(); + while (config == null || reread_config){ + try + { + config = + ((identity.Response)new identity.Request( + getSession().GetProperty("UserId"), + new String[] { + "realm", + "objecttype" + }, + new KeyValuePair[]{ + new KeyValuePair("realm",Bootstrap.getAppRealm()), + new KeyValuePair("objecttype","Agent") + }, + getSession() + ).getResponse()).property; + + reread_config = false; + Log.Init(); + } + catch (identity.IdentityException ex) + { + Log.Error(ex); + session = null; + } } return config; }