src/MinecraftJP.php
protected function exchangeToken() {
        $result = $this->requestAccessToken();
        if ($result && !empty($result['access_token'])) {
            $this->accessToken = $result['access_token'];
            $this->sessionStorage->write('access_token', $result['access_token']);
            if (!empty($result['refresh_token'])) {
                $this->refreshToken = $result['refresh_token'];
                $this->sessionStorage->write('refresh_token', $result['refresh_token']);
            }
            if (!empty($result['id_token'])) {
                $this->validateIdToken($result['id_token']);

                $this->user = $this->requestUserInfo();
                if ($this->user) {
                    $this->sessionStorage->write('user', $this->user);
                }
            }
        }
    }
protected function exchangeToken() {
        $result = $this->requestAccessToken();
        if ($result && !empty($result['access_token'])) {
            $this->accessToken = $result['access_token'];
            $this->sessionStorage->write('access_token', $result['access_token']);
            if (!empty($result['refresh_token'])) {
                $this->refreshToken = $result['refresh_token'];
                $this->sessionStorage->write('refresh_token', $result['refresh_token']);
            }
            if (!empty($result['id_token'])) {
                $this->validateIdToken($result['id_token']);

                $this->user = $this->requestUserInfo();
                if ($this->user) {
                    $this->sessionStorage->write('user', $this->user);
                }
            }
        }
    }
protected function exchangeToken ( ) { $ result = $ this -> requestAccessToken ( ) ; if ( $ result && ! empty ( $ result [ 'access_token' ] ) ) { $ this -> accessToken = $ result [ 'access_token' ] ; $ this -> sessionStorage -> write ( 'access_token' , $ result [ 'access_token' ] ) ; if ( ! empty ( $ result [ 'refresh_token' ] ) ) { $ this -> refreshToken = $ result [ 'refresh_token' ] ; $ this -> sessionStorage -> write ( 'refresh_token' , $ result [ 'refresh_token' ] ) ; } if ( ! empty ( $ result [ 'id_token' ] ) ) { $ this -> validateIdToken ( $ result [ 'id_token' ] ) ; $ this -> user = $ this -> requestUserInfo ( ) ; if ( $ this -> user ) { $ this -> sessionStorage -> write ( 'user' , $ this -> user ) ; } } } }
Exchange code to access_token
Exchange code to access_token