210813 ๊ฐœ๋ฐœ๊ธฐ๋ก: ๋„ค์ด๋ฒ„ ๊ฒ€์ƒ‰ api : Scope Status Invalid (error code 024) ํŠธ๋Ÿฌ๋ธ”์ŠˆํŒ…

2021. 8. 13. 23:44ใ†๐Ÿ“” TIL

โœ…  Scope Status Invalid: Authentication failed ( error code 024 )

๋„ค์ด๋ฒ„ (์ฑ…) ๊ฒ€์ƒ‰ API ๋ฅผ ์‚ฌ์šฉํ•˜๊ณ ์ž, api ํ…Œ์ŠคํŠธ ๋„๊ตฌ๋ฅผ ์‚ฌ์šฉํ–ˆ์Šต๋‹ˆ๋‹ค.

(Postman ๊ณผ ๋น„์Šทํ•œ api ํ…Œ์ŠคํŠธ ๋„๊ตฌ๋กœ, Insomnia ๋ฅผ ์‚ฌ์šฉ์ค‘์ž…๋‹ˆ๋‹ค)

์ ์ ˆํ•œ query, Header ๊ฐ’์„ ๋„ฃ๊ณ  GET method ๋กœ api๋ฅผ ํ˜ธ์ถœํ–ˆ์ง€๋งŒ, Scope Status Invalid ( error code 024 ) ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค.

 

๊ฒ€์ƒ‰api ์ด๋ฏ€๋กœ, query ๊ฐ’์— ๊ฒ€์ƒ‰์–ด๋ฅผ ์ž…๋ ฅํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. query ๋ˆ„๋ฝ์‹œ์—” Bad Request 400 ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

Header ์—๋Š” X-Naver-Client-Id ์™€ X-Naver-Client-Secret ๋‘ ๊ฐ’์„ ํ•„์ˆ˜์ ์œผ๋กœ ๋„ฃ์–ด์ค˜์•ผ ํ•ฉ๋‹ˆ๋‹ค.

 

ํ•„์š”ํ•œ ์ •๋ณด๋Š” ๋ชจ๋‘ ๋„ฃ์—ˆ์ง€๋งŒ, ์—ฌ์ „ํžˆ ์ธ์ฆ์— ์‹คํŒจํ–ˆ๋‹ค๋Š” ๋ฉ”์‹œ์ง€์™€ ํ•จ๊ป˜ 024์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค.

 

 

๐Ÿ™‹๐Ÿป‍โ™‚๏ธ  ์›์ธ๊ณผ ํ•ด๊ฒฐ

๋„ค์ด๋ฒ„ ๊ฐœ๋ฐœ์ž ํ™ˆํŽ˜์ด์ง€์˜ ๋ณธ์ธ์ด ๋“ฑ๋กํ•œ api ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ํŽ˜์ด์ง€๋กœ ์ ‘์†ํ•ฉ๋‹ˆ๋‹ค.

 

์›์ธ์€ ์‚ฌ์šฉAPI ์„ ํƒ๋ฐ•์Šค์— ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค. ์‚ฌ์šฉAPI ์„ค์ •์„ ๋‹จ์ถ•URL ์„ ์„ ํƒํ•œ ๊ฒƒ์ด ๋ฌธ์ œ์˜€์Šต๋‹ˆ๋‹ค.

์ œ๊ฐ€ ์‚ฌ์šฉํ•˜๊ณ  ์‹ถ์€ API ๋Š” ๊ฒ€์ƒ‰ ์ด๋ฏ€๋กœ, ๋‹จ์ถ•URL ๋Œ€์‹  ๊ฒ€์ƒ‰์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

 

 

 

๋‹ค์‹œ api test ๋„๊ตฌ์—์„œ ์ด์ „๊ณผ ๊ฐ™์ด api ๋ฅผ ํ˜ธ์ถœํ•˜๋ฉด ์ •์ƒ์ž‘๋™ํ•˜๋Š” ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.