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

Provide an example for NewTokenCredential #13

Open
patnaikshekhar opened this issue Jun 29, 2019 · 7 comments
Open

Provide an example for NewTokenCredential #13

patnaikshekhar opened this issue Jun 29, 2019 · 7 comments

Comments

@patnaikshekhar
Copy link

It would be very useful to see an example with the NewTokenCredential call. Is this used to authenticate using managed service identity? What should the value of Initial Token Value be?

Thanks!

@zezha-msft
Copy link
Contributor

Thanks @patnaikshekhar for reaching out!

The TokenCredential can be used for all scenarios. Are you particularly interested in MSI?

We can certain add a sample. I've logged this work item.

@patnaikshekhar
Copy link
Author

Yes a MSI example would be great. That is a pretty common use case. Thanks!

@VivekDevops
Copy link

I am also trying to use NewTokenCredential to access azure blob with MSI.
@patnaikshekhar where you able to achieve this?
@ zezha-msft It would great to see a example on this.

@zezha-msft
Copy link
Contributor

Hi @VivekDevops, thanks for reaching out! We are about to make some major improvements in this area. I'll make sure that we include an appropriate sample this time.

@VivekDevops
Copy link

VivekDevops commented May 11, 2020

Hi @zezha-msft thanks for the efforts. In the meantime, can you please give some guidance here. I am trying to use NewTokenCredential to access azure blob.

I am able to generate the TokenCredential. However when I try to use the same to access the azblob, I am getting below errors.


RESPONSE Status: 400 Authentication information is not given in the correct format. Check the value of Authorization header.
Content-Length: [298]
Content-Type: [application/xml]
Date: [Mon, 11 May 2020 06:00:19 GMT]
Server: [Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0]
X-Ms-Request-Id: [de4bc8a4-a01e-0074-7259-27ab1d000000]

The same token works, when I use the rest api instead of the azblob go sdk

@zezha-msft
Copy link
Contributor

Hi @VivekDevops, we have a test here that uses OAuth, perhaps it could help you?

@Segflow
Copy link

Segflow commented Jul 30, 2020

Can we have an example how to use ManagedIdentity?

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

4 participants