public async Task <string> GetToken(string code, string redirectUrl) { var appId = configuration["Authentication:Facebook:AppId"]; var appSecret = configuration["Authentication:Facebook:AppSecret"]; var result = await facebookClient.GetPublicAsync <dynamic>( "oauth/access_token", $"client_id={appId}&redirect_uri={redirectUrl}&client_secret={appSecret}&code={code}"); if (result == null) { return(null); } return(result.access_token); }