예제 #1
0
        public JwtAuthorizationContext(JwtAuthorizationOptions options, RemoteCallData remoteInvokeMessage)
        {
            Options             = options;
            Payload             = options.GetPayload();
            RemoteInvokeMessage = remoteInvokeMessage;
            if (remoteInvokeMessage.Parameters.ContainsKey("username"))
            {
                UserName = remoteInvokeMessage.Parameters["username"] + "";
            }

            if (remoteInvokeMessage.Parameters.ContainsKey("password"))
            {
                Password = remoteInvokeMessage.Parameters["password"] + "";
            }

            if (!string.IsNullOrEmpty(UserName))
            {
                Payload.Add("username", UserName);
            }
        }
예제 #2
0
 public JwtAuthorizationMiddleware(RequestDel next, JwtAuthorizationOptions options, ISerializer serializer)
 {
     _options    = options;
     _serializer = serializer;
     _next       = next;
 }