offline -> offline_access (addresses #248)

pull/263/head
Justin Richer 2013-01-18 18:03:39 -05:00
parent da43ba4d55
commit 8831bc64a2
5 changed files with 11 additions and 11 deletions

View File

@ -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);

View File

@ -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

View File

@ -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/'),

View File

@ -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>

View File

@ -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')) {