Skip to content

Commit

Permalink
fix: hybrid flow client
Browse files Browse the repository at this point in the history
  • Loading branch information
aguacongas committed Apr 13, 2022
1 parent 2204a50 commit 8bb72ce
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,16 @@ protected void OnStateChange(ModificationKind kind, object entity)
IdentityProviderRestrictions = new List<Entity.ClientIdpRestriction>(),
RedirectUris = new List<Entity.ClientUri>(),
Properties = new List<Entity.ClientProperty>(),
Resources = new List<Entity.ClientLocalizedResource>()
Resources = new List<Entity.ClientLocalizedResource>(),
AbsoluteRefreshTokenLifetime = 86400,
AccessTokenLifetime = 900,
IdentityTokenLifetime = 300,
AuthorizationCodeLifetime = 300,
DeviceCodeLifetime = 300,
SlidingRefreshTokenLifetime = 18000,
CibaLifetime = 300,
PollingInterval = 5,
RefreshTokenUsage = (int)RefreshTokenUsage.OneTimeOnly
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</AuthorizeView>
</div>
</div>
if (_showAllOptions || Model.IsAuthorizationCodeClient() || Model.IsDevice())
if (_showAllOptions || Model.IsWebClient())
{
<div class="mb-3 row">
<label class="col col-form-label" for="access-token">
Expand Down Expand Up @@ -102,15 +102,15 @@
<input class="form-check-input" type="radio" name="refresh-token-usage"
value="0"
checked="@(Model.RefreshTokenUsage == (int)Models.RefreshTokenUsage.ReUse)"
@onchange="@(() => Model.RefreshTokenUsage = (int)Models.RefreshTokenUsage.ReUse)" />
<label class="form-check-label" for="jwt" @onclick="@(() => Model.RefreshTokenUsage = (int)Models.RefreshTokenUsage.ReUse)">@Localizer["Re use"]</label>
@onchange="@(() => SetRefreshTokenUsage(Models.RefreshTokenUsage.ReUse))" />
<label class="form-check-label" for="jwt" @onclick="@(() => SetRefreshTokenUsage(Models.RefreshTokenUsage.ReUse))">@Localizer["Re use"]</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="refresh-token-usage"
value="1"
checked="@(Model.RefreshTokenUsage == (int)Models.RefreshTokenUsage.OneTimeOnly)"
@onchange="@(() => Model.RefreshTokenUsage = (int)Models.RefreshTokenUsage.OneTimeOnly)" />
<label class="form-check-label" for="reference" @onclick="@(() => Model.RefreshTokenUsage = (int)Models.RefreshTokenUsage.OneTimeOnly)">@Localizer["One time only"]</label>
@onchange="@(() => SetRefreshTokenUsage(Models.RefreshTokenUsage.OneTimeOnly))" />
<label class="form-check-label" for="reference" @onclick="@(() => SetRefreshTokenUsage(Models.RefreshTokenUsage.OneTimeOnly))">@Localizer["One time only"]</label>
</div>
</Authorized>
<NotAuthorized Context="refreshTokenUsage">
Expand All @@ -130,15 +130,15 @@
<input class="form-check-input" type="radio" name="refresh-token-expiration"
value="0"
checked="@(Model.RefreshTokenExpiration == (int)Models.RefreshTokenExpiration.Sliding)"
@onchange="@(() => Model.RefreshTokenExpiration = (int)Models.RefreshTokenExpiration.Sliding)" />
<label class="form-check-label" for="jwt" @onclick="@(() => Model.RefreshTokenExpiration = (int)Models.RefreshTokenExpiration.Sliding)">@Localizer["Sliding"]</label>
@onchange="@(() => SetRefreshTokenExpiration(Models.RefreshTokenExpiration.Sliding))" />
<label class="form-check-label" for="jwt" @onclick="@(() => SetRefreshTokenExpiration(Models.RefreshTokenExpiration.Sliding))">@Localizer["Sliding"]</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="refresh-token-expiration"
value="1"
checked="@(Model.RefreshTokenExpiration == (int)Models.RefreshTokenExpiration.Absolute)"
@onchange="@(() => Model.RefreshTokenExpiration = (int)Models.RefreshTokenExpiration.Absolute)" />
<label class="form-check-label" for="reference" @onclick="@(() => Model.RefreshTokenExpiration = (int)Models.RefreshTokenExpiration.Absolute)">@Localizer["Absolute"]</label>
@onchange="@(() => SetRefreshTokenExpiration(Models.RefreshTokenExpiration.Absolute))" />
<label class="form-check-label" for="reference" @onclick="@(() => SetRefreshTokenExpiration(Models.RefreshTokenExpiration.Absolute))">@Localizer["Absolute"]</label>
</div>
</Authorized>
<NotAuthorized Context="refreshTokenUsage">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,18 @@ private void SetTokenType(AccessTokenType accessTokenType)
TokenChanded();
}

private void SetRefreshTokenUsage(RefreshTokenUsage usage)
{
Model.RefreshTokenUsage = (int)usage;
TokenChanded();
}

private void SetRefreshTokenExpiration(RefreshTokenExpiration expiration)
{
Model.RefreshTokenExpiration = (int)expiration;
TokenChanded();
}

private void TokenChanded()
{
HandleModificationState.EntityUpdated(Model);
Expand Down

0 comments on commit 8bb72ce

Please sign in to comment.