Google Drive API integration in MVC3 Application

hellbender212

New Member
I have to integerate the Google Drive APi and for this i have downloaded a sample DrEdit project for my api project for MCV3 in asp.net. i am confused with drive controller as in index function i don't know what to and how to pass values in state parameter. The function is as follows:\[code\]public ActionResult Index(string state, string code) { try { IAuthenticator authenticator = Utils.GetCredentials(code, state); // Store the authenticator and the authorized service in session Session["authenticator"] = authenticator; Session["service"] = Utils.BuildService(authenticator); } catch (CodeExchangeException) { if (Session["service"] == null || Session["authenticator"] == null) { Response.Redirect(Utils.GetAuthorizationUrl("", state)); } } catch (NoRefreshTokenException e) { Response.Redirect(e.AuthorizationUrl); } DriveState driveState = new DriveState(); if (!string.IsNullOrEmpty(state)) { JavaScriptSerializer jsonSerializer = new JavaScriptSerializer(); driveState = jsonSerializer.Deserialize<DriveState>(state); } if (driveState.action == "open") { return OpenWith(driveState); } else { return CreateNew(driveState); } }\[/code\]i am getting the code values in oauth2callback controller but i am not getting the state value.
 
Back
Top