λ³Έλ¬Έ λ°”λ‘œκ°€κΈ°

μΉ΄ν…Œκ³ λ¦¬ μ—†μŒ

IOS κ°„νŽΈ 둜그인 / μ• ν”Œλ‘œκ·ΈμΈ ver.1

728x90
λ°˜μ‘ν˜•

🟑 apple developers setting

🐨  μ• ν”Œ 개발자 등둝

https://developer.apple.com/kr/ 에 μ ‘μ†ν•˜μ—¬ μ• ν”Œ 개발자 등둝을 ν•œλ‹€. (유료 : μ •ν™•ν•œ μš”κΈˆμ€ ν™ˆνŽ˜μ΄μ§€ μ°Έκ³ )

🐨 μ•± ID 등둝

μ•„λž˜μ˜ ν™”λ©΄μ—μ„œ μ‹λ³„μžλ‘œ νƒ­μœΌλ‘œ 이동.

 

Identifiers μ˜†μ˜ + λ²„νŠΌ 클릭

 

Description μ—λŠ” μ•Œμ•„λ³Ό 이름 (ex : logintest ) , Bundle ID μ—λŠ” μ‚¬μš©ν•  μ•± μ£Όμ†Œ ( ex : com.login.test ) μž…λ ₯ ν›„

Capabilities μ—μ„œ Sign in with Apple 클릭 ν›„ κ³„μ†ν•˜κΈ°.

 

🐨 μ„œλΉ„μŠ€ 아이디 생성 (μœ„μ˜ ν”ŒλŸ¬μŠ€ λ²„νŠΌ ν›„ Service IDs)

- μƒμ„±ν•œ ν›„ ν΄λ¦­ν•΄μ„œ μ ‘μ†ν•˜λ©΄ μ•„λž˜μ— μ²΄ν¬λ°•μŠ€μ™€ configure λ²„νŠΌμ΄ λ‚˜νƒ€λ‚œλ‹€. μ²΄ν¬ν•˜κ³  λ²„νŠΌ 클릭

 

- μƒμ„±ν–ˆλ˜ apple id와 return urls에 λ‘œκ·ΈμΈμ™„λ£Œ ν›„ λ°˜ν™˜ν•  url 을 λ„£λŠ”λ‹€

🐨 ν‚€ 생성

- Keys μ˜† + λ²„νŠΌ 클릭

 

- key 이름과 sign in with apple 을 클릭 ν›„ μ €μž₯

- key id와 key file 이 λ°œκΈ‰λ˜λŠ”λ° idλŠ” ν™ˆνŽ˜μ΄μ§€μ—μ„œ λ‹€μ‹œ λ³Ό 수 μžˆμ§€λ§Œ file은 처음 ν•œ λ²ˆλ°–μ— λ°œκΈ‰μ΄ μ•ˆλ˜λ‹ˆ λΆ„μ‹€ 쑰심.

πŸ”΄ config.json 생성

- κΈ°λ³Έν‹€

{
    "client_id": "",
    "team_id": "",
    "redirect_uri": "",
    "key_id": "",
    "scope": ""
}

μœ„μ˜ 각각의 κ°’λ“€ μ°Έμ‘°λŠ” μ•„λž˜ 링크

https://github.com/ananay/apple-auth/blob/master/SETUP.md  

 

🟠 μ†ŒμŠ€ κ΅¬ν˜„

1. 둜그인 νŽ˜μ΄μ§€λ‘œ 이동 λΌμš°ν„° κ΅¬ν˜„

import AppleAuth from 'apple-auth';
import fs from 'fs';
const config = fs.readFileSync('./config/iosconfig.json');


let auth = new AppleAuth(config, fs.readFileSync('./config/AuthKey_Y2WQX8897P.p8').toString(), 'text');

const router = Router();

router.get('/', (req, res) => {
    console.log(Date().toString() + 'GET /');
    res.send(`<a href="${auth.loginURL()}">Sign in with Apple</a>`);
});

 

🟀 Reference

https://github.com/ananay/apple-auth/blob/master/SETUP.md
https://github.com/ananay/apple-auth-example/blob/master/src/app.js

 

 

 

 

728x90
λ°˜μ‘ν˜•


Calendar
Β«   2024/09   Β»
일 μ›” ν™” 수 λͺ© 금 ν† 
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
Archives
Visits
Today
Yesterday