๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

Flutter

[Flutter/Firebase] Firebase auth / account-exists-with-different-credential

Flutter ์•ฑ์—์„œ Firebase์˜ Athenticatoin ์„ ํ†ตํ•ด ๋กœ๊ทธ์ธ์„ ๊ตฌํ˜„ํ–ˆ๋‹ค. ( Google / Apple / Twitter )
๊ทธ๋Ÿฐ๋ฐ, ์•„๋ž˜์™€ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค.

[VERBOSE-2:ui_dart_state.cc(199)] 
Unhandled Exception: 
[firebase_auth/account-exists-with-different-credential] 
An account already exists with the same email address 
but different sign-in credentials. 
Sign in using a provider associated with this email address.



์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•œ ์ƒํ™ฉ์€
1. Apple๋กœ ๋กœ๊ทธ์ธ
2. ๋กœ๊ทธ์•„์›ƒ ํ›„ Twitter๋กœ ๋กœ๊ทธ์ธ ์‹œ๋„ (Apple๊ณผ ๋™์ผํ•œ ์ด๋ฉ”์ผ ์‚ฌ์šฉ.)
3. ์œ„์™€ ๊ฐ™์€ ์—๋Ÿฌ ๋ฐœ์ƒ.



์„œ์น˜ํ•ด๋ณด๋‹ˆ, Firebase Console์—์„œ ์ด๋ฉ”์ผ ์ฃผ์†Œ๋‹น ๊ณ„์žฅ์„ 1๊ฐœ์”ฉ๋งŒ ์‚ฌ์šฉํ•˜๋„๋ก ์„ค์ •ํ–ˆ์„ ๋•Œ ๋ฐœ์ƒํ•œ๋‹ค.
์ด๋ฉ”์ผ ์ฃผ์†Œ๋‹น ๊ณ„์ • 1๊ฐœ๋ฅผ ์„ค์ •ํ•˜์ง€ ์•Š์€ ์ƒํƒœ์—์„œ ์œ„์™€ ๊ฐ™์€ ์ƒํ™ฉ์ผ ๋•Œ๋Š” ์ด๋ฉ”์ผ์ด ๋™์ผํ•ด๋„
Apple๊ณผ Twitter ๊ฐ๊ฐ ์ƒˆ๋กœ์šด uid๋ฅผ ๊ฐ€์ง„ User๊ฐ€ ์ƒ์„ฑ๋œ๋‹ค.

์ด๋ฉ”์ผ ์ค‘๋ณต ๊ฐ€์ž…์„ ํ—ˆ์šฉํ•˜๋Š”๊ฒŒ ์ง€๊ธˆ ์šฐ๋ฆฌ์˜ ์„œ๋น„์Šค์—์„œ๋Š” ๋” ์œ ๋ฆฌํ•˜๋‹ค๊ณ  ์ƒ๊ฐํ•˜์—ฌ, ํŒŒ์ด์–ด๋ฒ ์ด์Šค ์ธ์ฆ๊ด€๋ฆฌ์—์„œ ์œ„์— ๋ณด์ด๋Š” ๊ฒƒ์ฒ˜๋Ÿผ ์ด๋ฉ”์ผ ์ฃผ์†Œ๋‹น ๊ณ„์ • 1๊ฐœ ์„ค์ •์„ ๋ณ€๊ฒฝํ•˜์˜€๋‹ค.๐Ÿ˜„