New to Nutbox?

[UPVU] The authentication bug fix

1 comment

realmankwon
83
last year4 min read

Hello, I'm @realmankwon !!

Fixed a bug where you had to log in again after deleting your account due to authentication issues when viewing Draft, Bookmark, Schedule and UPVU Dashboard on upvu.org.

The reason why such a problem has occurred in the meantime is because of the authentication method called JWT.
JWT (JSON Web Tokens) is a function that issues a token to a user from the server and provides information after determining whether the user is a valid user through the token.
I think it was named JWT because the format of the token is JSON.

So why is JWT a problem?
There are access token and refresh token in JWT.
The access token contains information to be provided to the server, sign information, and expiration date, and refresh token contains only sign information and expiration date.
Access tokens have short expirations and refresh tokens have relatively long expirations.
The reason for this is to shorten the expiration date of the access token that contains information so that it is not exposed as much as possible.

At this time, it is possible to verify whether the expired access token is normal with the refresh token.
If verification passes, the access token is renewed and returned to the user.
If not passed, the access token cannot be renewed.
When the refresh token expires, you must log in again.

Upvu.org also went through the same authentication process as above to prevent other users from seeing your information.
However, when using the menus of Draft, Bookmark, Schedule, and UPVU Dashboard, there is only a verification part, and the part to renew the access token and return it to the user and save it has not been developed.
Because of this, if you delete your account and log in again, you will receive a new access token, so you can use it normally.

In the meantime, I know about it because of other projects, but I haven't had time to fix it, so I've been able to fix it today.
Please continue to use upvu.org a lot!!

안녕하세요 @realmankwon 입니다.

upvu.org 에서 Draft, Bookmark, Schedule 및 UPVU Dashboard 를 볼 때 인증 문제로 계정을 삭제 후 재로그인해야했던 버그를 수정하였습니다.

그동안 그런 문제가 발생했던 이유는 JWT 라는 인증 방식 때문입니다.
JWT(JSON Web Tokens) 는 서버에서 사용자에게 token을 발행하고 그 token을 통해서 유효한 사용자인지 판단 후에 정보를 제공해 주는 기능입니다.
token의 형태가 JSON 형태이기에 JWT라고 이름이 지어진 것 같습니다.

그럼 JWT 가 왜 문제가 되었을까요?
JWT 에는 access token 과 refresh token이 존재합니다.
access token 에는 서버에 제공해 주어야 하는 정보와 sign 정보, 만료일이 있고 refresh token에는 sign 정보와 만료일만 가지고 있습니다.
access token의 만료일은 짧고 refresh token의 만료일은 상대적으로 깁니다.
그 이유는 정보를 가지고 있는 access token 의 만료일을 짧게하여 최대한 노출이 되지 않도록 합니다.

이때 refresh token 으로 만료된 access token이 정상적인 것인지 검증이 가능합니다.
검증을 통과하면 access token을 갱신하여 유저에게 반환하게 됩니다.
만일 통과하지 않으면 access token은 갱신하지 못하게 됩니다.
refresh token까지 만료가 되면 로그인을 새로해야 합니다.

upvu.org 에서도 위와 같은 인증 처리 단계를 거치게 하여 다른 사용자가 나의 정보를 볼 수 없도록 처리를 하였습니다.
하지만 Draft, Bookmark, Schedule 및 UPVU Dashboard 의 메뉴를 사용할 때는 검증하는 부분만 있고 access token 을 갱신하여 사용자에게 반환한 후 저장하는 부분이 개발되어 있지 않았습니다.
이로 인해 계정을 삭제하고 재로그인을 하면 access token을 새로 받기 때문에 정상적으로 사용이 가능했던 것입니다.

그동안 다른 프로젝트로 인해서 알지만 고칠 시간이 없어서 못했던 부분을 오늘에서야 수정하게 되었습니다.
앞으로도 upvu.org 를 많이 애용해 주세요!!

Cc: @steemitblog, @steemcurator01, @steemcurator02 @steemchiller @justyy @symbionts @dev.supporters @steem.history @dlike @future.witness @maiyude @rnt1 @protoss20 @roadofrich @bangla.witness @xpilar.witness @etainclub @italygame @steem-agora @marcosdk @boylikegirl.wit @alexmove.witness @steemit-market @pennsif.witness @cotina @inwi @successgr.with @smt-wherein @ety001

Comments

Sort byBest