This repository was archived by the owner on Nov 20, 2018. It is now read-only.
File tree 1 file changed +35
-0
lines changed
src/Microsoft.AspNet.Http/Security
1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ public class AuthenticationProperties
17
17
internal const string ExpiresUtcKey = ".expires" ;
18
18
internal const string IsPersistentKey = ".persistent" ;
19
19
internal const string RedirectUriKey = ".redirect" ;
20
+ internal const string RefreshKey = ".refresh" ;
20
21
internal const string UtcDateTimeFormat = "r" ;
21
22
22
23
/// <summary>
@@ -160,5 +161,39 @@ public DateTimeOffset? ExpiresUtc
160
161
}
161
162
}
162
163
}
164
+
165
+ /// <summary>
166
+ /// Gets or sets if refreshing the authentication session should be allowed.
167
+ /// </summary>
168
+ public bool ? AllowRefresh
169
+ {
170
+ get
171
+ {
172
+ string value ;
173
+ if ( Dictionary . TryGetValue ( RefreshKey , out value ) )
174
+ {
175
+ bool refresh ;
176
+ if ( bool . TryParse ( value , out refresh ) )
177
+ {
178
+ return refresh ;
179
+ }
180
+ }
181
+ return null ;
182
+ }
183
+ set
184
+ {
185
+ if ( value . HasValue )
186
+ {
187
+ Dictionary [ RefreshKey ] = value . Value . ToString ( ) ;
188
+ }
189
+ else
190
+ {
191
+ if ( Dictionary . ContainsKey ( RefreshKey ) )
192
+ {
193
+ Dictionary . Remove ( RefreshKey ) ;
194
+ }
195
+ }
196
+ }
197
+ }
163
198
}
164
199
}
You can’t perform that action at this time.
0 commit comments