Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able fetch refresh token #60

Open
krunaldave24 opened this issue Oct 31, 2020 · 2 comments
Open

Not able fetch refresh token #60

krunaldave24 opened this issue Oct 31, 2020 · 2 comments

Comments

@krunaldave24
Copy link

Steps to reproduce

we have set all the information about the ad profile such as CSPAplication Id ,CSPApplicationSecret. when we try to login after set up values, it throw error for secret are not found at time of SetSecretAsync call. we try to run partner consent application to set refreshed token in key vault. we are using app only authentication in one of the tenants of our domains.
Notfound

What steps can reproduce the defect?

  1. Asp.net core 3.1 C#
  2. region Assembly Microsoft.Azure.KeyVault, Version=3.0.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
  3. Method signature
    public static Task SetSecretAsync(this IKeyVaultClient operations, string vaultBaseUrl, string secretName, string value, IDictionary<string, string> tags = null, string contentType = null, SecretAttributes secretAttributes = null, CancellationToken cancellationToken = default);

Expected behavior

we get a refresh token for the defined user of azure portal for for given app managed key and corelated app registration client Id successfully.

Share the expected output

Actual behavior

please find the attached screen shot not found as above.

What is the behavior observed?

Diagnostic logs

at Microsoft.Azure.KeyVault.KeyVaultClient.d__66.MoveNext()
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.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Microsoft.Azure.KeyVault.KeyVaultClientExtensions.<GetSecretAsync>d__12.MoveNext() 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.TaskAwaiter1.GetResult()
at Application.Services.KeyVaultProvider.d__11.MoveNext() in D:\Projects\ClientApp\Src\Services\Application\Services\KeyVaultProvider.cs:line 51

Environment

azure cloud
visual studio IDE

@thepill
Copy link
Contributor

thepill commented Apr 8, 2021

Im having the same problem.

Probably the procedure is not quite comprehensible for me. The code in CSPApplication demo seems to assume that the refresh token is already in the key vault?
There also seems not to be any form of initial login procedure within the CSPApplication demo?

@thepill
Copy link
Contributor

thepill commented Apr 8, 2021

@krunaldave24 i found my confusion and got it to work following #45 (comment)

You have to run the constent-web-sample first which will create the necessary secret within the key vault.
After that the CSPApplication demo works if you fix this problem: #55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants