Esempio n. 1
0
        public override async Task InitializeAsync()
        {
            await base.InitializeAsync();

            var resp = await client.GetAsync("/a/app/login/Salt");

            resp.EnsureSuccessStatusCode();
            identity = JsonConvert.DeserializeObject <RemoteIdentity>(await resp.Content.ReadAsStringAsync());
            Assert.Equal("/Food/Salt", identity.token.scope);
            Assert.Equal(username, identity.user.username);

            // authenticate a client on behalf of the application
            appClient = fx.getClient();
            appClient.addBearerToken(identity.token);
            appClient.DefaultRequestHeaders.Add(Gatekeeper.Constants.APP_SECRET_HEADER, Constants.Apps.APP_SECRET);
        }
 public void SetRemoteIdentity(RemoteIdentity identity)
 {
     remoteIdentity = identity;
 }
Esempio n. 3
0
 public void SetUp()
 {
     mSut = new RemoteIdentity(new ReadOnlyCollection <IProperty>(new List <IProperty>()));
 }
Esempio n. 4
0
 public void SetUp()
 {
     mSut = new RemoteIdentity();
 }