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 the client is flagged to allow for refresh tokens, make sure it's got the right granted scopes
|
||||||
if (client.isAllowRefresh()) {
|
if (client.isAllowRefresh()) {
|
||||||
client.getScope().add("offline");
|
client.getScope().add("offline_access");
|
||||||
} else {
|
} else {
|
||||||
client.getScope().remove("offline");
|
client.getScope().remove("offline_access");
|
||||||
}
|
}
|
||||||
|
|
||||||
return clientRepository.saveClient(client);
|
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 the client is flagged to allow for refresh tokens, make sure it's got the right scope
|
||||||
if (newClient.isAllowRefresh()) {
|
if (newClient.isAllowRefresh()) {
|
||||||
newClient.getScope().add("offline");
|
newClient.getScope().add("offline_access");
|
||||||
} else {
|
} else {
|
||||||
newClient.getScope().remove("offline");
|
newClient.getScope().remove("offline_access");
|
||||||
}
|
}
|
||||||
|
|
||||||
return clientRepository.updateClient(oldClient.getId(), newClient);
|
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
|
// 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
|
// 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();
|
OAuth2RefreshTokenEntity refreshToken = new OAuth2RefreshTokenEntity(); //refreshTokenFactory.createNewRefreshToken();
|
||||||
|
|
||||||
// make it expire if necessary
|
// make it expire if necessary
|
||||||
|
|
|
@ -19,7 +19,7 @@ INSERT INTO client_scope_TEMP (owner_id, scope) VALUES
|
||||||
('client', 'email'),
|
('client', 'email'),
|
||||||
('client', 'address'),
|
('client', 'address'),
|
||||||
('client', 'phone'),
|
('client', 'phone'),
|
||||||
('client', 'offline');
|
('client', 'offline_access');
|
||||||
|
|
||||||
INSERT INTO redirect_uri_TEMP (owner_id, redirect_uri) VALUES
|
INSERT INTO redirect_uri_TEMP (owner_id, redirect_uri) VALUES
|
||||||
('client', 'http://localhost/'),
|
('client', 'http://localhost/'),
|
||||||
|
|
|
@ -115,9 +115,9 @@
|
||||||
</label>
|
</label>
|
||||||
</c:if>
|
</c:if>
|
||||||
|
|
||||||
<c:if test="${not empty scopes['offline']}">
|
<c:if test="${not empty scopes['offline_access']}">
|
||||||
<label for="scope_offline" class="checkbox">
|
<label for="scope_offline_access" class="checkbox">
|
||||||
<input type="checkbox" name="scope_offline" id="scope_offline" value="offline" checked="checked">
|
<input type="checkbox" name="scope_offline_access" id="scope_offline_access" value="offline_access" checked="checked">
|
||||||
<i class="icon-time"></i> offline access
|
<i class="icon-time"></i> offline access
|
||||||
</label>
|
</label>
|
||||||
</c:if>
|
</c:if>
|
||||||
|
|
|
@ -549,8 +549,8 @@
|
||||||
authorizedGrantTypes.push('refresh_token');
|
authorizedGrantTypes.push('refresh_token');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($.inArray('offline', scopes) == -1) {
|
if ($.inArray('offline_access', scopes) == -1) {
|
||||||
scopes.push("offline");
|
scopes.push("offline_access");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$('disableRefreshTokenTimeout').is(':checked')) {
|
if (!$('disableRefreshTokenTimeout').is(':checked')) {
|
||||||
|
|
Loading…
Reference in New Issue