Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update :: Update Server URL #16

Merged
merged 1 commit into from
Oct 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 21 additions & 16 deletions src/main/java/gauth/impl/GAuthImpl.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
package gauth.impl;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import gauth.GAuth;
import gauth.enums.TokenType;
import gauth.response.GAuthCode;
import gauth.response.GAuthToken;
import gauth.response.GAuthUserInfo;
import gauth.exception.GAuthException;
import gauth.exception.InvalidEncodingException;
import gauth.exception.JsonNotParseException;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Map;

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPatch;
Expand All @@ -19,14 +16,22 @@
import org.apache.http.impl.client.HttpClientBuilder;
import org.json.simple.JSONObject;

import java.io.*;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import gauth.GAuth;
import gauth.enums.TokenType;
import gauth.exception.GAuthException;
import gauth.exception.InvalidEncodingException;
import gauth.exception.JsonNotParseException;
import gauth.response.GAuthCode;
import gauth.response.GAuthToken;
import gauth.response.GAuthUserInfo;

public class GAuthImpl implements GAuth {
private final ObjectMapper mapper = new ObjectMapper();
private final String GAuthServerURL = "https://port-0-gauth-backend-85phb42bluutn9a7.sel5.cloudtype.app/oauth";
private final String ResourceServerURL = "https://port-0-gauth-resource-server-71t02clq411q18.sel4.cloudtype.app";
private final String GAuthServerURL = "https://server-gauth.msg-team.com/oauth";
private final String ResourceServerURL = "https://resource-gauth.msg-team.com";

public GAuthToken generateToken(String email, String password, String clientId, String clientSecret, String redirectUri) {
String code = generateCode(email, password).getCode();
Expand Down Expand Up @@ -184,4 +189,4 @@ private Map<String, String> sendPost(Map<String, String> body, String token, Str



}
}