Skip to content

Commit a73a486

Browse files
committed
Include the base URL in the token cache key, so multiple cloud instances can be used simultaneously with the same username
1 parent bb7f006 commit a73a486

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/corelib/Providers/Rackspace/CloudIdentityProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ public virtual UserAccess GetUserAccess(CloudIdentity identity, bool forceCacheR
718718
if (rackspaceCloudIdentity == null)
719719
rackspaceCloudIdentity = new RackspaceCloudIdentity(identity);
720720

721-
var userAccess = TokenCache.Get(string.Format("{0}/{1}", rackspaceCloudIdentity.Domain, rackspaceCloudIdentity.Username), () =>
721+
var userAccess = TokenCache.Get(string.Format("{0}:{1}/{2}", UrlBase, rackspaceCloudIdentity.Domain, rackspaceCloudIdentity.Username), () =>
722722
{
723723
var auth = new AuthRequest(identity);
724724
var response = ExecuteRESTRequest<AuthenticationResponse>(identity, new Uri(UrlBase, "/v2.0/tokens"), HttpMethod.POST, auth, isTokenRequest: true);
@@ -755,7 +755,7 @@ protected virtual UserAccess Impersonate(RackspaceImpersonationIdentity identity
755755
if (identity == null)
756756
throw new ArgumentNullException("identity");
757757

758-
var impToken = TokenCache.Get(string.Format("{0}/imp/{1}/{2}", identity.Username, identity.UserToImpersonate.Domain == null ? "none" : identity.UserToImpersonate.Domain.Name, identity.UserToImpersonate.Username), () =>
758+
var impToken = TokenCache.Get(string.Format("{0}:{1}/imp/{2}/{3}", UrlBase, identity.Username, identity.UserToImpersonate.Domain == null ? "none" : identity.UserToImpersonate.Domain.Name, identity.UserToImpersonate.Username), () =>
759759
{
760760
const string urlPath = "/v2.0/RAX-AUTH/impersonation-tokens";
761761
var request = BuildImpersonationRequestJson(identity.UserToImpersonate.Username, 600);

0 commit comments

Comments
 (0)