예제 #1
0
파일: Tests.cs 프로젝트: HamzaRahmani/OIBot
        public void ScopeMapTest()
        {
            var scopes = EsiScopeMap.GetScopeStrings(EsiScope.CharactersReadMedals | EsiScope.AllClones).ToList();

            Assert.True(scopes.Contains("esi-characters.read_medals.v1"));
            Assert.True(scopes.Contains("esi-clones.read_clones.v1"));
            Assert.True(scopes.Contains("esi-clones.read_implants.v1"));
        }
예제 #2
0
        public string GetAuthUrl(string callbackUri, EsiScope scope, string state)
        {
            var escScopes   = Uri.EscapeDataString(string.Join(" ", EsiScopeMap.GetScopeStrings(scope)));
            var escCallback = Uri.EscapeDataString(callbackUri);
            var escState    = Uri.EscapeDataString(state);

            return($"https://login.eveonline.com/oauth/authorize?response_type=code&redirect_uri={escCallback}&realm=ESI&client_id={_clientId}&scope={escScopes}&state={escState}");
        }