/// <summary> /// Completes the authorization process. Access tokens and list of administrated companies are retrived and set to control that opened the dialog. /// </summary> private void CompleteAuthorization(ILinkedInData data, Uri url) { if (LinkedInProvider.Authorize(data, url, out var token)) { List <CMS.SocialMarketing.LinkedInCompany> companies; try { companies = CMS.SocialMarketing.LinkedInHelper.GetUserCompanies(token.AccessToken); } catch (Exception ex) { LogAndShowError("LinkedInCompanyAccessToken", "GET_COMPANIES", ex); return; } string formattedExpiration = token.Expiration.HasValue ? TimeZoneHelper.ConvertToUserTimeZone(token.Expiration.Value, true, MembershipContext.AuthenticatedUser, SiteContext.CurrentSite) : String.Empty; string json = JsonConvert.SerializeObject( new { accessToken = token.AccessToken, accessTokenSecret = "", tokenExpiration = token.Expiration.HasValue ? token.Expiration.Value.ToString("g", CultureInfo.InvariantCulture) : String.Empty, tokenExpirationString = formattedExpiration, tokenAppId = Parameters["AppInfoId"], companies }, new JsonSerializerSettings { StringEscapeHandling = StringEscapeHandling.EscapeHtml } ); // Set retrieved access token to the opener window string script = String.Format(@" if(wopener.linkedInCompanyControl && wopener.linkedInCompanyControl['{0}']) {{ wopener.linkedInCompanyControl['{0}'].setData({1}); }} CloseDialog();", Parameters["ClientID"], json); ScriptHelper.RegisterStartupScript(Page, typeof(string), "TokenScript", script, true); } }
public UsersController(ILinkedInData data) : base(data) { }
public BaseApiController(ILinkedInData data) { this.Data = data; }
public SessionAuthorizeAttribute(ILinkedInData data) { this.Data = data; }
public HomeController(ILinkedInData data) : base(data) { }
protected BaseController(ILinkedInData data, User userProfile) :this(data) { this.UserProfile = userProfile; }
protected BaseController(ILinkedInData data) { this.Data = data; }
public UserSessionManager(IOwinContext owinContext, ILinkedInData data) { this.Data = data; this.OwinContext = owinContext; }
protected BaseController(ILinkedInData data, User userProfile) : this(data) { this.UserProfile = userProfile; }