我的OAuth2权限将此返回给我:
eyJlbWFpbCI6InJ1dGdlckB5b3UuY28iLCJ1cGRhdGVkX2F0IjoxNTIzODcyOTE3LCJleHAiOjE1MjQwNDEyNzEsImlhdCI6MTUyNDA0MTE1MSwic3ViIjoicnV0Z2VyQFlPVS1URUNITk9MT0dJRVMtR1JPVVAtTElNSVRFRCIsImlzcyI6Imh0dHBzOi8veW91LXRlY2hub2xvZ2llcy1ncm91cC1saW1pdGVkLnZtd2FyZWlkZW50aXR5LmFzaWEvU0FBUy9hdXRoIiwiYXVkIjpbIllPVV9Qb3J0YWwiXSwiYXV0aF90aW1lIjoxNTI0MDMxNDUxLCJhenAiOiJZT1VfUG9ydGFsIiwiYXRfaGFzaCI6IkZ2a2Z4Q2lRTW1VWFhNREctc1BBN0EiLCJjX2hhc2giOiJOVF9zdGlmbEgtZktfSVBwSjExbVNRIiwiZ2l2ZW5fbmFtZSI6IlJ1dGdlciIsImZhbWlseV9uYW1lIjoiSHVpam1hbnMiLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZX0
将该字符串复制并粘贴到:
我收到了一个不错的JSON正文。这一个:
{"email":"rutger@you.co","updated_at":1523872917,"exp":1524041271,"iat":1524041151,"sub":"rutger@YOU-TECHNOLOGIES-GROUP-LIMITED","iss":"https://you-technologies-group-limited.vmwareidentity.asia/SAAS/auth","aud":["YOU_Portal"],"auth_time":1524031451,"azp":"YOU_Portal","at_hash":"FvkfxCiQMmUXXMDG-sPA7A","c_hash":"NT_stiflH-fK_IPpJ11mSQ","given_name":"Rutger","family_name":"Huijmans","email_verified":true}
我似乎无法在我的Mac OS应用程序中使用Base64 Decode。无论我尝试过什么。
例如:
let decodedData = Data(base64Encoded: idToken)!
let decodedString = String(data: decodedData, encoding: .utf8)!
print(decodedString)
这次崩溃。