graphQL-client-unity
graphQL-client-unity copied to clipboard
Select type of Authentication
First off, kick ass package! This is absolutely amazing, phenominal work!! :tada:
I would like to request the ability to add what type of Auth is used when making requests. I noticed you've been using Bearer, however for the GraphQL APIs I'm using, the method we use is JWT.
It would be great if there was a AuthConstants.cs file, containing say
# AuthConstants.cs
public class AuthMethod {
public const string BEARER = "Bearer";
public const string JWT = "JWT";
...
}
and you could reference the Auth method you wished when setting the auth token, i.e.
myGraphQLReference.SetAuthToken(AuthMethod.BEARER, myToken);
Just a thought! Might save some others time who maybe aren't using Bearer as their source of API auth.
Thanks!!
I am learning how to code for my summer break. Do you know how I would do it for Basic Auth?
Hey @jnalfaro awesome! Could you clarify what you mean by "do it for Basic Auth"?