graphQL-client-unity icon indicating copy to clipboard operation
graphQL-client-unity copied to clipboard

Select type of Authentication

Open bocklucas opened this issue 5 years ago • 2 comments

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!!

bocklucas avatar Jul 26 '20 17:07 bocklucas

I am learning how to code for my summer break. Do you know how I would do it for Basic Auth?

jnalfaro avatar Jun 23 '21 03:06 jnalfaro

Hey @jnalfaro awesome! Could you clarify what you mean by "do it for Basic Auth"?

bocklucas avatar Jun 25 '21 01:06 bocklucas