You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug DoOIDCCallbackAsync can't be called with an unauthenticated client, similar to #348
VaultSharp Version
1.17.5.1
Vault Version
1.18.4
Does this work with Vault CLI?
Yes
Sample Code Snippet
vartempAuthMethod=newNullAuthMethodInfo();vartempClient=newVaultClient(newVaultClientSettings(vaultUri.ToString(),tempAuthMethod));varcallbackUrl=(awaittempClient.V1.Auth.JWT.GetOIDCAuthURLAsync($"{CallbackHost}/oidc/callback",roleName:"oidc-role",mountPoint:"oidc").ConfigureAwait(false)).Data.AuthorizationURL;// Getting callback data is omitted for brevitystringstate="";stringcode="";// Exception!vartoken=(awaittempClient.V1.Auth.JWT.DoOIDCCallbackAsync(state,HttpUtility.ParseQueryString(callbackUri.Query)["nonce"],code,mountPoint:"oidc").ConfigureAwait(false)).AuthInfo.ClientToken;
System.NullReferenceException: Object reference not set to an instance of an object.
at VaultSharp.V1.AuthMethods.Custom.CustomAuthMethodLoginProvider.<GetVaultTokenAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at VaultSharp.Core.Polymath.<MakeVaultApiRequest>d__21`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at VaultSharp.V1.AuthMethods.JWT.JWTAuthMethodProvider.<DoOIDCCallbackAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at <application code>
Any additional info
Adding unauthenticated: true should be enough to fix this issue.
The text was updated successfully, but these errors were encountered:
Describe the bug
DoOIDCCallbackAsync
can't be called with an unauthenticated client, similar to #348VaultSharp Version
1.17.5.1
Vault Version
1.18.4
Does this work with Vault CLI?
Yes
Sample Code Snippet
Exception Details/Stack Trace/Error Message
Any additional info
Adding
unauthenticated: true
should be enough to fix this issue.The text was updated successfully, but these errors were encountered: