我在ios中使用Linkedin SDK.我正在使用以下代码来验证用户
[LISDKSessionManager createSessionWithAuth:[NSArray arrayWithObjects:LISDK_BASIC_PROFILE_PERMISSION, LISDK_EMAILADDRESS_PERMISSION, nil]
state:nil//@"some state"
showGoToAppStoreDialog:YES
successBlock:^(NSString *returnState) {
}
errorBlock:^(NSError *error) {
}
];
Run Code Online (Sandbox Code Playgroud)
通过使用此代码,我可以打开linkedin应用程序但无法从linkedin应用程序回调到我的应用程序.没有打电话
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
NSLog(@"%s url=%@","app delegate application openURL called ", [url absoluteString]);
if ([LISDKCallbackHandler shouldHandleUrl:url]) {
return [LISDKCallbackHandler application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
}
return YES;
Run Code Online (Sandbox Code Playgroud)
}
我在URL Schemes中使用"liMY_APPID".还尝试从LinkedIn iOS SDK Bundle Suffix 请帮我如何从linkedin app获得回调
实际上,我的应用程序是通过linkedin 应用程序和webview 使用linkedin 登录的。使用linkedin 登录工作正常,但如果linkedin 应用程序不可用,我将使用webview 来处理登录。这也工作正常,但今天它突然卡在了一些代码异常中。我在我的 Linkedin 对话框类中获得了空访问令牌,所以我喜欢放置 try catch 但之后它会显示空白的 webview 我不知道该怎么做知道。这是我的linkedin对话框代码
public class LinkedinDialog extends Dialog
{
private ProgressDialog progressDialog = null;
public static LinkedInApiClientFactory factory;
public static LinkedInOAuthService oAuthService;
public static LinkedInRequestToken liToken;
private WebView mWebView;
private Context mContext;
public LinkedinDialog(Context context, ProgressDialog progressDialog)
{
super(context);
mContext = context;
this.progressDialog = progressDialog;
}
@Override
protected void onCreate(Bundle savedInstanceState)
{
requestWindowFeature(Window.FEATURE_NO_TITLE);// must call before super.
super.onCreate(savedInstanceState);
setContentView(R.layout.ln_dialog);
setWebView();
}
/**
* set webview.
*/
private void setWebView() …Run Code Online (Sandbox Code Playgroud) 我们登录了LinkedIn代码并与LinkedIn Javascript SDK完美配合,几天前我们突然开始得到这个:
Blocked a frame with origin "https://platform.linkedin.com" from accessing a frame
with origin "https://OUR_SITE". Protocols, domains, and ports must match.
Run Code Online (Sandbox Code Playgroud)
登录无法完成(它从LinkedIn返回到我们的页面并永远等待).我不知道为什么当一切正常工作时我们开始得到这个错误(我们没有更改关于登录机制的单行代码,或允许原始标题/文件,或LinkedIn设置等)但我决定添加platform.linkedin.com到允许原始标题:
Access-Control-Allow-Origin: https://platform.linkedin.com
我可以看到响应正确发送的标头.但是,我仍然得到了同样的错误.
为什么会这样开始发生?我们如何防止这种情况发生?我的意思是,我知道微软收购了LinkedIn但是来了,他们无法快速打破它.
我正在尝试将 LinkedIn api 与 JavaScript 一起使用(我是新手......)。这是我的简单代码:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://platform.linkedin.com/in.js">
api_key: XXXXXXXXXXXXXXXXX
authorize: true
onLoad: onLinkedInLoad
</script>
<script type="text/javascript">
// Setup an event listener to make an API call once auth is complete
function onLinkedInLoad() {
IN.Event.on(IN, "auth", getProfileData);
}
// Handle the successful return from the API call
function onSuccess(data) {
console.log("onSuccess() " + data);
console.log(data);
}
// Handle an error response from the API call
function onError(error) {
console.log("onError() " + JSON.stringify(error));
console.log(error);
}
// …Run Code Online (Sandbox Code Playgroud) 我的主要问题是获取令牌。除了这一步,我走得更远。
在Linkedin API的文档中,描述了两种获取令牌的方法。女巫是正确的吗?
1) https://developer.linkedin.com/docs/v2/oauth2-client-credentials-flow 2) https://developer.linkedin.com/docs/oauth2#configure
我了解,为了使用新的Linkedin API(合作伙伴的API),我应该使用第一个(https://developer.linkedin.com/docs/v2/oauth2-client-credentials-flow)
这是我的请愿书:
https://www.linkedin.com/oauth/v2/accessToken?grant_type=client_credentials&client_id= {MYCLIENTID}&client_secret = {MYCLIENTSECRET}
响应:错误“ access_denied” error_description“不允许该应用程序创建应用程序令牌”
我被困在这里。
使用第二个(https://developer.linkedin.com/docs/oauth2#configure),我实际上得到了一个令牌:https : //www.linkedin.com/oauth/v2/authorization ? response_type = code & client_id = {MYCLIENTID} &redirect_uri = {MYURIREDIRECT}&state = {STATERETURNED}
这将返回用于发出令牌请求的代码(和状态):
https://www.linkedin.com/oauth/v2/accessToken?grant_type=authorization_code&client_id= {MYCLIENTID}&client_secret = {MYCLIENTSECRET}&redirect_uri = {MYURIREDIRECT}&code = {CODERETURNED}
我得到令牌。但这不是正确的方法,是吗?
我有一个小型节点应用程序,它在使用 Oath2 进行身份验证(授权)后从 LinkedIn 检索访问令牌。
现在我有了令牌,我想发出后续请求以获取用户配置文件数据。问题是,当我提出请求时,错误显示如下:
{"success":false,"msg":"403 - {\"serviceErrorCode\":100,\"message\":\"Not enough permissions to access: GET /me\",\"status\":403}"}
Run Code Online (Sandbox Code Playgroud)
我已经勾选了 LinkedIn 应用程序中的所有“状态”选项。
根据 LinkedIn API 文档,令牌需要在标头中发送。像这样:
(参考:https : //developer.linkedin.com/docs/oauth2#requests)
获取个人资料数据的路径如下:https : //api.linkedin.com/v2/me
这是我希望用户点击以获取他们的个人资料数据的路线:
app.get("/user",async (req,res)=>{
console.log(token); /* token object is available in higher scope from previous request */
var options = {
url: "https://api.linkedin.com/v2/me",
method: 'GET',
headers: {
'Host': "api.linkedin.com",
'Connection': "Keep-Alive",
'Authorization': 'Bearer ' + token.access_token
},
json: true // Automatically stringifies the body to JSON
};
try {
var …Run Code Online (Sandbox Code Playgroud) 需要帮助的人,
有没有人可以调用 LinkedIn V2/me版本。我能够成功地对 V1 版本进行 API 调用,得到响应作为成员所需的信息。
当调用https://api.linkedin.com/v2/me ?format=json 时,方法 :GET in postman by access token in header 作为 Authorization.It 抛出以下错误
回复 :
{
"serviceErrorCode": 100,
"message": "Not enough permissions to access: GET /me",
"status": 403
}
Run Code Online (Sandbox Code Playgroud)
我对 V1 和 V2 版本使用了相同的OAuth2.0访问令牌。自 2015 年 8 月 10 日起获得r_basicprofile领英消费者应用平台 V1 版本的许可。
从我们的应用程序调用 V1 API 没有问题。Linkedin 将是日落 V1 版本,因此只需要根据来自 LinkedIn 端的 X 应用程序 DLP 的限制使用公共 API。
什么是LinkedIn 公共 API端点和所需的 API 访问权限? …
在v1.0中,我们可以使用以下api获取公共资料网址。
但是在v2.0中,当我尝试获取r_basicprofile时,它给了我Erro 403(您没有获得/ me权限),但是我可以使用r_liteprofile获取ID,名字,姓氏。
https://api.linkedin.com/v2/me
我如何获得public-profile-url或vanityName?
谢谢!
我正在尝试在登录时构建一个带有linkedin 集成的Android 应用程序,但在按下按钮后出现错误。它正在重定向到linkedin 应用程序,但没有显示任何授权屏幕并重定向到我的应用程序。
Code:
LISessionManager.getInstance(getApplicationContext()).init(this, buildScope(), new AuthListener() {
@Override
public void onAuthSuccess() {
// Authentication was successful. You can now do
// other calls with the SDK.
Toast.makeText(MainActivity.this,"Authrization Success",Toast.LENGTH_SHORT).show();
fetchDetailsLinkedin();
}
@Override
public void onAuthError(LIAuthError error) {
Log.e("Auth Error",error.toString());
// Handle authentication errors
Toast.makeText(MainActivity.this,"Authrization Failed",Toast.LENGTH_SHORT).show();
}
}, true);
Run Code Online (Sandbox Code Playgroud)
同时显示授权失败。它显示的错误消息。
com.example.loginintegration E/Auth Error: { "errorCode": "UNKNOWN_ERROR", "errorMessage": "传入的移动标识符无效\"com.example.loginintegration\"" }
这com.example.loginintegration是我的包名。
谁能帮我解决这个问题?
我已经阅读了 api v2 的几乎所有文档,并且在任何地方都没有提到主题标签。如果没有,是否可以使用特定关键字过滤公共帖子(来自公司和普通用户)?
linkedin-api ×10
linkedin ×8
javascript ×3
android ×2
ios ×2
access-token ×1
api ×1
cors ×1
exception ×1
login ×1
node.js ×1
oauth-2.0 ×1
token ×1
xcode ×1