如何解决iOS应用程序中Harvest API OAuth2重定向URL的正确格式
从iOS应用程序中使用OAuth2和Harvest API进行身份验证时,重定向URL的正确格式是什么?
oauth.com指出,本机应用程序的重定向URL看起来像#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void) {
const int DIMMAX=100;
char pharse[DIMMAX+1];
int stringLength;
int choice=0;
while(choice != '5'){
printf("1)Enter a new pharse.");
printf("\n2)");
printf("\n3)");
printf("\n4)");
printf("\n5)\n");
scanf("%d",&choice);
switch(choice){
case 1:
printf("\n=====================\n");
scanf ("%[^\n]%*c",pharse); //<-----------------------It jumps here
printf("\n=====================\n");
stringLength = strlen(pharse);
printf("%s",pharse);
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
default:
printf("\nNot a valid option.\n\n");
break;
}
}
return 0;
}
。问题是,Harvest不接受这样的重定向URL。似乎需要在其前面加上myapp://callback
/ http
前缀,这会在身份验证流程结束时重定向回iOS应用程序时引起问题。我似乎在Harvest API documentation中找不到任何相关内容。
我在Xcode中添加了一个URL类型,其中将https
的值设置为Identifier
,将com.example.myapp
的值设置为URL Schemes
。无论我在Harvest中指定什么重定向URL(给定上述格式),身份验证流始终会抱怨MyApp
。我可以使用来自
Safari cannot open the page because the server cannot be found
URL手动打开应用程序解决方法
听起来您正在寻找要用于从网络电话进行重定向的URL。我不确定oath2,但在SAML上就像
https://您要登录的地方/ SSOpage?RelayState = https://您要去的地方
我希望这可以帮助您找到答案。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。