title: iOS Swift - Authenticate wordpress user using Alamofire?
body: <p>I want my app users to login with their Wordpress credentials. I've installed Alamofire &amp; SwiftyJSON in order to do this, and I'm able to succesfully GET Wordpress endpoints to my app (via the Wordpress REST API). That said, I'm not sure how to authenticate my user on login?</p>
  <p>I'm trying out the below, but the response is simply nil. Am I posting the user parameters to the wrong endpoint? Help is appreciated! I'm stumped.</p>
  <pre><code> let parameters: Parameters = [
              &quot;username&quot;: userField.text!,
              &quot;password&quot;: passField.text!,
              
          ]
  
          
          AF.request(&quot;http://myurl.com/wp-json/wp/v2/users&quot;, method: .post,  parameters: parameters, encoding: JSONEncoding.default)
          
          
                  .responseJSON { response in
                      switch response.result {
                      case .success(let value):
                          if let json = value as? [String: Any] {
                              print(json[&quot;Result&quot;] as? Int)
                          }
                      case .failure(let error):
                          print(error)
                      }
              }
  </code></pre>