locked
GetClientToken returns 401: Unauthorized RRS feed

  • Question

  • Hi,

     

    I'm trying to implement Customer Identification on my commerical VirtualEarth site, according to the principles laid down in the blockbuster http://msdn2.microsoft.com/en-us/library/bb924353.aspx

     

    I use the sample code almost verbatim.  I use the accountID and password that I verified in the Verify Credentials area of the CSS.

     

    When I run it, I get a 401: Unauthorized error when I call GetClientToken.

     

    Behold:

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    Dim commonService As New MapPointService.CommonServiceSoap()

    commonService.Url = "https://common.virtualearth.net/find-30/common.asmx"

    commonService.Credentials = New System.Net.NetworkCredential( _

    ConfigurationManager.AppSettings("MapPointAccount"), _

    ConfigurationManager.AppSettings("MapPointPassword"))

    ' Create the TokenSpecification object to pass to GetClientToken.

    Dim tokenSpec As New TokenSpecification()

    ' Use the Page object to retrieve the end-client’s IPAddress.

    tokenSpec.ClientIPAddress = Page.Request.UserHostAddress

    ' The maximum allowable token duration is 480 minutes (8 hours).

    ' The minimum allowable duration is 15 minutes.

    tokenSpec.TokenValidityDurationMinutes = 480

    '' Now get a token from the Virtual Earth Platform service.

    _clientToken = commonService.GetClientToken(tokenSpec)

    End Sub

     

    My account is only authorized for staging.  Is there a different commonService.Url that I should use?  Please, O Virtual Earth Jedi, heed my plaintitive cry!

    Friday, March 21, 2008 7:36 PM

Answers

  • Ok so the news is the clientToken system is only working for production accounts currently. This is a known issue and will be resolved in comming weeks.

    I can assure you the system works as specified when it is enabled but unfortunaltly there is no way for you develop against it until your account is set to production (paid service).

    If this is causing you problems talk to your account/sales contact.

    I'll let you know when it has been resolved.

    John.

    Friday, March 28, 2008 6:40 AM
    Moderator

All replies

  • Your account has not been enabled for access. I had the same problem and had to get my account upgraded.

    I've sent an email off on your behalf to see if we can get to the bottom of this.

    John.

    Friday, March 21, 2008 11:04 PM
    Moderator
  •  

    John, thank you.

     

    Next time I'm with my old lady, I'll tell her to scream out your name.

    Monday, March 24, 2008 7:55 PM
  • I am having to same problem here : I tested the credentials on VEP CSS and it worked fine, but I get an unauthorized response when trying to retrieve a client token. How do I make sure my account is activated ?

    Thanks

     

    Thursday, March 27, 2008 10:03 PM
  • Ok so the news is the clientToken system is only working for production accounts currently. This is a known issue and will be resolved in comming weeks.

    I can assure you the system works as specified when it is enabled but unfortunaltly there is no way for you develop against it until your account is set to production (paid service).

    If this is causing you problems talk to your account/sales contact.

    I'll let you know when it has been resolved.

    John.

    Friday, March 28, 2008 6:40 AM
    Moderator
  • Help; Same Error

     

    Is this resolved? If not does anyone know a workaround?

     

    Thanks

     

    Friday, April 11, 2008 5:50 PM
  • I'm at MSFT next week and will see if I can get a solution. I suspect that have been very busy with the 6.1 release yesterday.

    John.

    Saturday, April 12, 2008 3:00 PM
    Moderator
  •  Gil Young wrote:

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    Dim commonService As New MapPointService.CommonServiceSoap()

    commonService.Url = "https://common.virtualearth.net/find-30/common.asmx"

    commonService.Credentials = New System.Net.NetworkCredential( _

    ConfigurationManager.AppSettings("MapPointAccount"), _

    ConfigurationManager.AppSettings("MapPointPassword"))

    ' Create the TokenSpecification object to pass to GetClientToken.

    Dim tokenSpec As New TokenSpecification()

    ' Use the Page object to retrieve the end-client’s IPAddress.

    tokenSpec.ClientIPAddress = Page.Request.UserHostAddress

    ' The maximum allowable token duration is 480 minutes (8 hours).

    ' The minimum allowable duration is 15 minutes.

    tokenSpec.TokenValidityDurationMinutes = 480

    '' Now get a token from the Virtual Earth Platform service.

    _clientToken = commonService.GetClientToken(tokenSpec)

    End Sub



    I have a newbie question regarding this code, which I've seen in the SDK.  This code generates the token, however, how do you get the _clientToken back to the control itself?

    Thanks.
    Monday, April 14, 2008 2:54 PM
  •  SoulSolutions wrote:

    I'm at MSFT next week and will see if I can get a solution. I suspect that have been very busy with the 6.1 release yesterday.

    John.

     

    So "Staging environment for Customer Identification (transaction counting)." (see http://johanneskebeck.spaces.live.com/Blog/cns!42E1F70205EC8A96!3858.entry) does not indicate the problem is solved?

     

    I'd also like to ask for a workaround. Or is there another possibility to have a look at some sample data for the reports at Customer Services / View Virtual Earth Platform Reports?

    Tuesday, April 15, 2008 9:18 AM
  • Sorry, I know that this is an old thread, but it seems that after the 6.2 release we're having the same issue.

    I've created a Development Account and setup everything. The token is generated and sent with each tile request, but the transaction reports remains empty.

    Can anyone confirim if your Staging transaction reports are working?

     

    Thanks!

    Nicolas

     

    Thursday, October 2, 2008 2:05 PM
  • Hi,

        For the first time it will take upto 1 week to active your account after that only the report will be generated.

    Regards
    Raja.M
    Thursday, October 23, 2008 6:26 AM