Super simple Box oauth flow simple sample
Replace client_id, client_secret, redirect_uri with your Box Application parameters. Deploy app, access http://hostname/authenticate
You should be redirected to Box's authentication page and asked to grant access to the app. After successfully authenticating with your box account, you should be displayed with your Access token and a refresh token.