Class OAuth

    • Constructor Detail

      • OAuth

        public OAuth()
    • Method Detail

      • applyToParams

        public void applyToParams​(List<Pair> queryParams,
                                  Map<String,​String> headerParams,
                                  Map<String,​String> cookieParams)
        Description copied from interface: Authentication
        Apply authentication settings to header and query params.
        Specified by:
        applyToParams in interface Authentication
        Parameters:
        queryParams - List of query parameters
        headerParams - Map of header parameters
        cookieParams - Map of cookie parameters
      • setAccessToken

        public void setAccessToken​(String accessToken)
      • getRefreshToken

        public String getRefreshToken()
      • getClientId

        public String getClientId()
      • setAuth

        public void setAuth​(String clientId,
                            String refreshToken)
      • setClientId

        public void setClientId​(String clientId)
      • getAccessToken

        public String getAccessToken()
      • getJWT

        public JWT getJWT()
        Get JWT (JSON Web Token) WARNING: The JWT is unverified. Verifying the JWT is beyond the scope of this library. As ESI will verify the token when used. See the SSO documentation for JWT Token validation for details: https://github.com/esi/esi-docs/blob/master/docs/sso/validating_eve_jwt .md
        Returns:
        Unverified JWT or null
      • getAuthorizationUri

        public String getAuthorizationUri​(String redirectUri,
                                          Set<String> scopes,
                                          String state)
        Get the authorization uri, where the user logs in.
        Parameters:
        redirectUri - Uri the user is redirected to, after successful authorization. This must be the same as specified at the Eve Online developer page.
        scopes - Scopes of the Eve Online SSO.
        state - This should be some secret to prevent XRSF, please read: http://www.thread-safe.com/2014/05/the-correct-use-of-state- parameter-in.html
        Returns:
      • getCodeVerifier

        public String getCodeVerifier()
        Returns:
        the PKCE code verifier used to generate the last code challenge (RFC 7636)
      • finishFlow

        public void finishFlow​(String code,
                               String state,
                               String codeVerifier)
                        throws ApiException
        Finish the oauth flow after the user was redirected back.
        Parameters:
        code - Code returned by the Eve Online SSO
        state - This should be some secret to prevent XRSF see getAuthorizationUri
        codeVerifier - The PKCE code verifier used to generate the code challenge (RFC 7636). Required if not called by the same instance that called `getAuthorizationUri`
        Throws:
        ApiException
      • finishFlow

        public void finishFlow​(String code,
                               String state)
                        throws ApiException
        Finish the oauth flow after the user was redirected back.
        Parameters:
        code - Code returned by the Eve Online SSO
        state - This should be some secret to prevent XRSF see getAuthorizationUri
        Throws:
        ApiException