예제 #1
0
        public void EnsureAuthenticationToken(ForgeAPI.Interface.IInputsCommon inputs)
        {
            if (inputs.AuthenticationToken == null)
            {
                inputs.AuthenticationToken = m_AuthenticationService.Authenticate(
                    CConstants.DEFAULT_ACCESS_SCOPES);
            }

            if (inputs.AuthenticationToken.IsExpired)
            {
                inputs.AuthenticationToken = m_AuthenticationService.Authenticate(
                    inputs.AuthenticationToken.AccessScopes);
            }
        }
예제 #2
0
        public async Task <IActionResult> ForgeAuthenticateViewer()
        {
            ForgeAPI.Interface.Authentication.IToken token;

            token = await Task.Run(
                () =>
                m_ForgeAPI_AuthenticationService.Authenticate(new List <ForgeAPI.Interface.Enums.E_AccessScope>()
            {
                ForgeAPI.Interface.Enums.E_AccessScope.Data_Read,
                ForgeAPI.Interface.Enums.E_AccessScope.Viewables_Read
            }));

            return(Ok(token));
        }