We uploaded the wrong cert which caused the error. MMW Code have you
uploaded a pem format cert for your domain( 
https://www.google.com/accounts/ManageAccount
) ? you need to create one and upload it to be able to use secure=1 on
h9 server. The next url also needs to be a domain because it won't
work using localhost.


The weird  thing here is we are already in the final stage, we're
already using /health in our authsub. But there is one person from
google healthservices which is getting an error and shes the only one
whois getting that error. I don't have the exact error msg yet but I
am assuming this a connection problem/timeout  error. My question is,
is that possible(connection timeout/error)? The error happens after
during the  process(after she selects a profile to link) linking/
requesting of token.

On Oct 2, 3:25 pm, "Eric (Google)" <[EMAIL PROTECTED]> wrote:
> If you feel like sharing, it may help others using
> .NET if you post what was giving you trouble.
>
> Thanks,
> Eric
>
> On Oct 2, 1:56 pm, unggoi <[EMAIL PROTECTED]> wrote:
>
>
>
> > Problem solved. Yes it was a cert problem. Thank you very much for you
> > help eric
>
> > On Sep 30, 8:07 pm, "Eric (Google)" <[EMAIL PROTECTED]> wrote:
>
> > > Your code looks correct to me :\
>
> > > Here's a couple of questions/suggestions for you:
> > > - Can you post the full authsub link that your app
> > >   redirects to?
>
> > > - Verify that the correct .pem cert is uploaded to Google
> > >   usinghttps://www.google.com/accounts/ManageDomains
>
> > > - Verify that the private key is readable by your web server.
> > >   It may be that thetokenexchange is the request that's failing.
>
> > > - What happens if you run the sample app I posted?
>
> > > Eric
>
> > > On Sep 30, 7:06 pm, unggoi <[EMAIL PROTECTED]> wrote:
>
> > > > Thanks for responding eric.
>
> > > > Sorry about that. Here's the complete code. my feed query is 
> > > > "https://www.google.com/h9/feeds/profile/default/-/medication"; which is 
> > > > placed
> > > > on a configuration file. When I test it using secure=false everything
> > > > is working. But when I change the authsublink to implement secure
> > > > tokenserror401 appears. Is it a cert issue or something is wrong in
> > > > my code?
>
> > > >             Stringtoken= Request.QueryString["token"];
> > > >             String rsaKey =
> > > > ConfigurationManager.AppSettings["google_rsa_key"];
> > > >             String googleSessionToken;
> > > >             if (rsaKey == string.Empty)
> > > >                 googleSessionToken =
> > > > AuthSubUtil.exchangeForSessionToken(token, null).ToString();
> > > >             else
> > > >             {
> > > >                 X509Certificate2 temp = new X509Certificate2(rsaKey,
> > > > ConfigurationManager.AppSettings["google_rsa_password"]);
> > > >                 RSACryptoServiceProvider privateKey = temp.PrivateKey
> > > > as RSACryptoServiceProvider;
> > > >                 googleSessionToken =
> > > > AuthSubUtil.exchangeForSessionToken(token, privateKey).ToString();
> > > >             }
> > > >            Session[GlobalConst.GOOGLETOKEN] = googleSessionToken;
>
> > > > And for retreiving the feed here's the code
>
> > > > GAuthSubRequestFactory authFactory = new
> > > > GAuthSubRequestFactory(ConfigurationManager.AppSettings["google_service_nam
> > > >  ­
> > > > e"],
> > > > ConfigurationManager.AppSettings["google_app_name"]);
> > > >         authFactory.Token= (String)Session[GlobalConst.GOOGLETOKEN];
> > > >         String rsaKey =
> > > > ConfigurationManager.AppSettings["google_rsa_key"];
>
> > > >         if (rsaKey != string.Empty)
> > > >         {
> > > >             X509Certificate2 temp = new
> > > > X509Certificate2(rsaKey,ConfigurationManager.AppSettings["google_rsa_passwo
> > > >  ­
> > > > rd"]);
> > > >             RSACryptoServiceProvider privateKey = temp.PrivateKey as
> > > > RSACryptoServiceProvider;
> > > >             authFactory.PrivateKey = privateKey;
> > > >         }
>
> > > >         Service service = new Service(authFactory.Service,
> > > > authFactory.ApplicationName);
> > > >         service.RequestFactory = authFactory;
>
> > > > FeedQuery query = new FeedQuery();
> > > >         query.Uri = new
> > > > Uri(ConfigurationManager.AppSettings["google_feedquery_uri"]);
> > > >         query.ExtraParameters =
> > > > ConfigurationManager.AppSettings["google_query_parameters"];
>
> > > > AtomFeed healthFeed = service.Query(query);
>
> > > > On Sep 30, 6:48 pm, "Eric (Google)" <[EMAIL PROTECTED]> wrote:
>
> > > > > Hi unggoi,
>
> > > > > I don't seem where you're querying a feed.  Your code
> > > > > seems to stop at creating the service object.
>
> > > > > Here's a C# example that worked for 
> > > > > me:http://code.google.com/p/googlehealthsamples/source/browse/trunk/dotN...
>
> > > > > Eric
>
> > > > > On Sep 30, 6:16 pm, unggoi <[EMAIL PROTECTED]> wrote:
>
> > > > > > I'm getting a 401errorunauthorized when I'm using a securetoken.
> > > > > > Everything works fine when I set secure to false. Is there something
> > > > > > wrong on my code or is this a cert issue?
> > > > > > I have domain.pfx and domain.cer is this correct? Please help and
> > > > > > thank you very much in advance.
>
> > > > > > Here's my code
>
> > > > > >             Stringtoken= Request.QueryString["token"];
> > > > > >             String rsaKey =
> > > > > > ConfigurationManager.AppSettings["google_rsa_key"];
> > > > > >             String googleSessionToken;
> > > > > >             if (rsaKey == string.Empty)
> > > > > >                 googleSessionToken =
> > > > > > AuthSubUtil.exchangeForSessionToken(token, null).ToString();
> > > > > >             else
> > > > > >             {
> > > > > >                 X509Certificate2 temp = new X509Certificate2(rsaKey,
> > > > > > ConfigurationManager.AppSettings["google_rsa_password"]);
> > > > > >                 RSACryptoServiceProvider privateKey = 
> > > > > > temp.PrivateKey
> > > > > > as RSACryptoServiceProvider;
> > > > > >                 googleSessionToken =
> > > > > > AuthSubUtil.exchangeForSessionToken(token, privateKey).ToString();
> > > > > >             }
> > > > > >            Session[GlobalConst.GOOGLETOKEN] = googleSessionToken;
>
> > > > > > And for retreiving the feed here's the code
>
> > > > > > GAuthSubRequestFactory authFactory = new
> > > > > > GAuthSubRequestFactory(ConfigurationManager.AppSettings["google_service_nam
> > > > > >  e"],
> > > > > > ConfigurationManager.AppSettings["google_app_name"]);
> > > > > >         authFactory.Token= (String)Session[GlobalConst.GOOGLETOKEN];
> > > > > >         String rsaKey =
> > > > > > ConfigurationManager.AppSettings["google_rsa_key"];
>
> > > > > >         if (rsaKey != string.Empty)
> > > > > >         {
> > > > > >             X509Certificate2 temp = new
> > > > > > X509Certificate2(rsaKey,ConfigurationManager.AppSettings["google_rsa_passwo
> > > > > >  rd"]);
> > > > > >             RSACryptoServiceProvider privateKey = temp.PrivateKey as
> > > > > > RSACryptoServiceProvider;
> > > > > >             authFactory.PrivateKey = privateKey;
> > > > > >         }
>
> > > > > >         Service service = new Service(authFactory.Service,
> > > > > > authFactory.ApplicationName);
> > > > > >         service.RequestFactory = authFactory;- Hide quoted text -
>
> > > > > - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Health Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/googlehealthdevelopers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to