Hi Nicu,
Thanks for the reply. Here is more detail. The code is C#. The error message is “Only authenticated users can access the REST API.” with a 401 error. With Force Login deactive, I get back the token.
var url = $"{mysiteurl}?rest_route=/simple-jwt-login/v1/auth&email={username}&password={password}";
var client = _clientFactory.CreateClient();
var content = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("", "")
});
// Call the Simple JWT plugin to get an auth token.
var response = await client.PostAsync(url, content);
string result = response.Content.ReadAsStringAsync().Result;
Token amosu = JsonConvert.DeserializeObject<Token>(result);
//Redirect to my site with the token...
public struct Token
{
public bool success;
public DataResult data;
}
public struct DataResult
{
public string jwt;
}`
`