Hi Pravin, This is explained on https://github.com/googleads/googleads-dotnet-lib/blob/master/examples/AdWords/CSharp/OAuth/OAuthLogin.aspx.cs#L75
Cheers, Anash On Friday, June 5, 2015 at 5:23:09 AM UTC-4, Pravin Yadav wrote: > > Hi Anash, > You given suggestions are useful to me. > > but now getting issue to access offline authentication > without visit account permissions page make connection and retrieve data. > > > now i need process of storing/save the OAuth2 Provider for > future use in database. i use your previous message link for > (regard)offline adwords account access but i can't implement it properly. > > then how to save oAuth.RefreshToken,oAuth.AccessToken, > oAuth.UpdateOn, Oauth.ExpiresIn or any other property value if needed for > offline account access > and what is flow of that. > > Please reply. > > > On Friday, May 15, 2015 at 1:14:38 AM UTC+5:30, Anash P. Oommen (AdWords > API Team) wrote: >> >> Hi Pravin, >> >> it simply saves the access and refresh tokens into a database. >> >> - You should build a web service (asmx) that reads the refresh and access >> tokens from the database, construct an AdWordsUser and make an API call. >> https://github.com/googleads/googleads-dotnet-lib/blob/master/examples/AdWords/CSharp/OAuth/OAuthLogin.aspx.cs#L80 >> >> has some comments on how to reconstruct a credentials object from scratch. >> >> - You should set RetryCount >> <https://github.com/googleads/googleads-dotnet-lib/blob/master/examples/AdWords/CSharp/OAuth/Web.config#L30> >> >> in your asmx service's web.config so that it will fetch a new access token >> using the refresh token in case the access token has expired. If this >> fails, the asmx service should throw an exception (and probably put a flag >> in the database) so that the UI can then ask the user to reauthorize your >> application the next time they visit your site. >> >> Hope this helps. Let me know if you have more questions, >> >> Cheers, >> Anash P. Oommen, >> AdWords API Advisor. >> >> On Wednesday, May 13, 2015 at 1:17:19 AM UTC-4, Pravin Yadav wrote: >>> >>> >>> >>> On Wednesday, May 13, 2015 at 10:35:45 AM UTC+5:30, Pravin Yadav wrote: >>>> >>>> >>>> Hi.. >>>>>> >>>>>> In detail about errors. >>> >>> >>>> *When i >>>>>> using >>>>>> HttpContext.Current.Response.Redirect(oAuth.GetAuthorizationUrl()); >>>>>> //access_type is not offline that time getting following error at same >>>>>> line* >>>>>> >>>>>> *Consuming Service* >>>>>> >>>>>> localhost.MaiaAdWordsService service = new >>>>>> localhost.MaiaAdWordsService(); >>>>>> >>>>>> DataTable dt = new DataTable(); >>>>>> >>>>>> dt = service.AuthonticationConfig();//Getting Error at >>>>>> here.................. >>>>>> Gdv_TestService.DataSource = dt; >>>>>> >>>>>> Getting following error at highlighted line.. >>>>>> >>>>> >>>> >>>> >>>> >>>> >>>> *The request failed with the error message:--<html><head><title>Object >>>> moved</title></head><body><h2>Object moved to <a >>>> href="https://accounts.google.com/o/oauth2/auth?scope=https%3a%2f%2fwww.googleapis.com%2fauth%2fadwords&state=callback&redirect_uri=http%3a%2f%2flocalhost%3a25232%2fMaiaAdWordsService.asmx&response_type=code&client_id=4516991244-33c20b7an0j8m1e1gtin9mr2l9vc46vr.apps.googleusercontent.com&access_type=offline >>>> >>>> <https://accounts.google.com/o/oauth2/auth?scope=https%3a%2f%2fwww.googleapis.com%2fauth%2fadwords&state=callback&redirect_uri=http%3a%2f%2flocalhost%3a25232%2fMaiaAdWordsService.asmx&response_type=code&client_id=4516991244-33c20b7an0j8m1e1gtin9mr2l9vc46vr.apps.googleusercontent.com&access_type=offline>">here</a>.</h2></body></html>* >>>> >>>> *I cant open permission page and accept Permissions at the time of >>>> service consuming.* >>>> >>> >>> *And When i using access_type offline i.e.* >>> HttpContext.Current.Response.Redirect(" >>> https://accounts.google.com/o/oauth2/auth?scope=https%3a%2f%2fwww.googleapis.com%2fauth%2fadwords&state=callback&redirect_uri=http%3a%2f%2flocalhost%3a1366%2fOAuthLogin.aspx&response_type=code&client_id=4516991244-33c20b7an0j8m1e1gtin9mr2l9vc46vr.apps.googleusercontent.com&access_type=offline"); >>> >>> that time below error at same line >>> >>>> >>>> >>>>> Unable to connect to the remote server" >>>>>> >>>>> -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and Google+: https://googleadsdeveloper.blogspot.com/ https://plus.google.com/+GoogleAdsDevelopers/posts =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To post to this group, send email to adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/adwords-api. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/9c4b485b-207b-40cb-af29-3ce96ab4f0bd%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.