更新時間:2019-11-20
通過此方式可以拉起用戶設備上已經(jīng)安裝的CloudLink應用并根據(jù)鏈接中傳入的參數(shù)執(zhí)行登錄鑒權(quán)。
業(yè)務流程
1 2 3 4 5 6 7 8 9 10 11 12 13 |
- (void)ssoLogin { NSString *address = 服務器地址; NSString *port = 服務器端口; NSString *domain = 企業(yè)域名; NSString *userTicket = 授權(quán)code; NSString *loginString = [NSString stringWithFormat:"cloudlink://welinksoftclient/h5page?page=ssoLogin&server_url=%@&port=%@&domain=%@&code=%@", address, port, domain, userTicket]; NSURL *loginUrl = [NSURL URLWithString:loginString]; if (@available(iOS 10.0, *)) { [[UIApplication sharedApplication] openURL:loginUrl options:@{} completionHandler:nil]; } else { [[UIApplication sharedApplication] openURL:loginUrl]; } } |