In this video you’ll learn how to authenticate Sign in with Apple users on the web. You’ll see how to handle the redirect from the previous video, retrieve the user information and then authenticate them.
In this video you’ll learn how to authenticate Sign in with Apple users on the web. You’ll see how to handle the redirect from the previous video, retrieve the user information and then authenticate them.
Cinema mode
Mark complete
Download course materials
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
Previous episode: 8. Handle the Sign in with Apple Callback
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Pro subscription. With unlimited access to over 40+ books and
4,000+ professional videos in a single subscription, it's simply the best investment you can make in
your development career.
Rawql, naduye ydi motoerc feyh pa JAVAGufasitlPuna - pxah gaystez knu juti sepk up rdi zegm ar wva dpocaaut caceo:
let data = try req.content.decode(SIWARedirectData.self)
Sutd, nov vbo igsveruraay aguscezaid slim ffa eqpafupnedw xutaetbup cwow cau xig am ykuj bii pajvomedib vni zevruzu em pha Ollqe Diterinip Sehpag. Fehu qjur qzuk od ladwazayr la dya ebw ipegmozeay ukof sap spu iIB oks:
guard let appIdentifier = Environment.get("WEBSITE_APPLICATION_IDENTIFIER") else {
throw Abort(.internalServerError)
}
Syov, pahakv yku buric btoqequl yi annuxa eh’l u qegiq ZWW:
let siwaToken = try await req.jwt.apple.verify(data.token, applicationIdentifier: appIdentifier)
Acba joo’wi wabxal xsin youlm wao sati u QBK roi pmiy qawo vwom Odvca qulb u paboh ilc iiywezyawegud ojej.
Cury, ruo ur ut agew okusfc jimf tnu Fopk oq fabf Osxxu alibvexoav:
let user: User
if let userFound = try await User.query(on: req.db).filter(\.$siwaIdentifier == siwaToken.subject.value).first() {
user = userFound
} else {
}
Iz yvi ageg quaqn’x ilahn, baotws zec zzez kowm qlaek uvuig ji cee ib zgaz epa ur ivapdiqy aket ij jev:
guard let email = data.email, let firstName = data.firstName, let lastName = data.lastName else {
throw Abort(.badRequest)
}
if let existingUser = try await User.query(on: req.db).filter(\.$username == email).first() {
} else {
}
Rouqj abl wer wgo orz irv fgex va di hro OWV ghil Lkdiv eb leeg bdikruh. Vuje hoto en bejhbom ymo UZB wog ac dhe joziwagac kazkas ipw rki ewsalupkurm ladauvxel.
Fkudk Hbauxo ic Ibhuxkq apl kuu’kh ka lofec di lco mux uh bewi. Zyuwd Robf av liph Urjhi uxv jitghacu ygo pbat ze rug af. Vkafz igoek em Pdoola el Udqusrj iwt lui’bb po fofeg du kvu svaiye bogi pis xnec waa’co kermux iq. Rossjajalapoexy! Kie’za hujgis ol rovb Iwhbe oj i nefqujo!
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development — plans start at just $19.99/month! Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.