offline -> offline_access (addresses #248)
parent
da43ba4d55
commit
8831bc64a2
|
@ -88,9 +88,9 @@ public class DefaultOAuth2ClientDetailsEntityService implements ClientDetailsEnt
|
|||
|
||||
// if the client is flagged to allow for refresh tokens, make sure it's got the right granted scopes
|
||||
if (client.isAllowRefresh()) {
|
||||
client.getScope().add("offline");
|
||||
client.getScope().add("offline_access");
|
||||
} else {
|
||||
client.getScope().remove("offline");
|
||||
client.getScope().remove("offline_access");
|
||||
}
|
||||
|
||||
return clientRepository.saveClient(client);
|
||||
|
@ -166,9 +166,9 @@ public class DefaultOAuth2ClientDetailsEntityService implements ClientDetailsEnt
|
|||
|
||||
// if the client is flagged to allow for refresh tokens, make sure it's got the right scope
|
||||
if (newClient.isAllowRefresh()) {
|
||||
newClient.getScope().add("offline");
|
||||
newClient.getScope().add("offline_access");
|
||||
} else {
|
||||
newClient.getScope().remove("offline");
|
||||
newClient.getScope().remove("offline_access");
|
||||
}
|
||||
|
||||
return clientRepository.updateClient(oldClient.getId(), newClient);
|
||||
|
|
|
@ -112,7 +112,7 @@ public class DefaultOAuth2ProviderTokenService implements OAuth2TokenEntityServi
|
|||
|
||||
// attach a refresh token, if this client is allowed to request them and the user gets the offline scope
|
||||
// TODO: tie this to some kind of scope service
|
||||
if (client.isAllowRefresh() && scopes.contains("offline")) {
|
||||
if (client.isAllowRefresh() && scopes.contains("offline_access")) {
|
||||
OAuth2RefreshTokenEntity refreshToken = new OAuth2RefreshTokenEntity(); //refreshTokenFactory.createNewRefreshToken();
|
||||
|
||||
// make it expire if necessary
|
||||
|
|
|
@ -19,7 +19,7 @@ INSERT INTO client_scope_TEMP (owner_id, scope) VALUES
|
|||
('client', 'email'),
|
||||
('client', 'address'),
|
||||
('client', 'phone'),
|
||||
('client', 'offline');
|
||||
('client', 'offline_access');
|
||||
|
||||
INSERT INTO redirect_uri_TEMP (owner_id, redirect_uri) VALUES
|
||||
('client', 'http://localhost/'),
|
||||
|
|
|
@ -115,9 +115,9 @@
|
|||
</label>
|
||||
</c:if>
|
||||
|
||||
<c:if test="${not empty scopes['offline']}">
|
||||
<label for="scope_offline" class="checkbox">
|
||||
<input type="checkbox" name="scope_offline" id="scope_offline" value="offline" checked="checked">
|
||||
<c:if test="${not empty scopes['offline_access']}">
|
||||
<label for="scope_offline_access" class="checkbox">
|
||||
<input type="checkbox" name="scope_offline_access" id="scope_offline_access" value="offline_access" checked="checked">
|
||||
<i class="icon-time"></i> offline access
|
||||
</label>
|
||||
</c:if>
|
||||
|
|
|
@ -549,8 +549,8 @@
|
|||
authorizedGrantTypes.push('refresh_token');
|
||||
}
|
||||
|
||||
if ($.inArray('offline', scopes) == -1) {
|
||||
scopes.push("offline");
|
||||
if ($.inArray('offline_access', scopes) == -1) {
|
||||
scopes.push("offline_access");
|
||||
}
|
||||
|
||||
if (!$('disableRefreshTokenTimeout').is(':checked')) {
|
||||
|
|
Loading…
Reference in New Issue