[SCB-2740]refactor folder structure and api (#46)

diff --git a/api/authentication-server/endpoint/pom.xml b/api/authentication-server/endpoint/pom.xml
deleted file mode 100644
index a78e29f..0000000
--- a/api/authentication-server/endpoint/pom.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one or more
-  ~ contributor license agreements.  See the NOTICE file distributed with
-  ~ this work for additional information regarding copyright ownership.
-  ~ The ASF licenses this file to You under the Apache License, Version 2.0
-  ~ (the "License"); you may not use this file except in compliance with
-  ~ the License.  You may obtain a copy of the License at
-  ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.servicecomb.fence</groupId>
-    <artifactId>authentication-server-api</artifactId>
-    <version>0.0.1-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>authentication-server-api-endpoint</artifactId>
-  <packaging>jar</packaging>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.servicecomb.fence</groupId>
-      <artifactId>authentication-server-api-service</artifactId>
-      <version>${project.parent.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.servicecomb.fence</groupId>
-      <artifactId>authentication-common-api-service</artifactId>
-      <version>${project.parent.version}</version>
-    </dependency>
-  </dependencies>
-</project>
diff --git a/api/authentication-server/endpoint/src/main/resources/microservice.yaml b/api/authentication-server/endpoint/src/main/resources/microservice.yaml
deleted file mode 100644
index e7d51d2..0000000
--- a/api/authentication-server/endpoint/src/main/resources/microservice.yaml
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-##      http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-
-# override common configurations in common module
-servicecomb-config-order: -1
-
-GithubOAuthService:
-  urls:
-    - rest://github.com:443?sslEnabled=true
diff --git a/api/authentication-server/pom.xml b/api/authentication-server/pom.xml
deleted file mode 100644
index 14d128d..0000000
--- a/api/authentication-server/pom.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one or more
-  ~ contributor license agreements.  See the NOTICE file distributed with
-  ~ this work for additional information regarding copyright ownership.
-  ~ The ASF licenses this file to You under the Apache License, Version 2.0
-  ~ (the "License"); you may not use this file except in compliance with
-  ~ the License.  You may obtain a copy of the License at
-  ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.servicecomb.fence</groupId>
-    <artifactId>authentication-api</artifactId>
-    <version>0.0.1-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>authentication-server-api</artifactId>
-  <packaging>pom</packaging>
-
-  <modules>
-    <module>service</module>
-    <module>endpoint</module>
-  </modules>
-</project>
\ No newline at end of file
diff --git a/api/authentication-server/service/pom.xml b/api/authentication-server/service/pom.xml
deleted file mode 100644
index 1666029..0000000
--- a/api/authentication-server/service/pom.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one or more
-  ~ contributor license agreements.  See the NOTICE file distributed with
-  ~ this work for additional information regarding copyright ownership.
-  ~ The ASF licenses this file to You under the Apache License, Version 2.0
-  ~ (the "License"); you may not use this file except in compliance with
-  ~ the License.  You may obtain a copy of the License at
-  ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.servicecomb.fence</groupId>
-    <artifactId>authentication-server-api</artifactId>
-    <version>0.0.1-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>authentication-server-api-service</artifactId>
-  <packaging>jar</packaging>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.servicecomb.fence</groupId>
-      <artifactId>authentication-common-api-service</artifactId>
-      <version>${project.parent.version}</version>
-    </dependency>
-  </dependencies>
-
-</project>
diff --git a/api/common/endpoint/pom.xml b/api/common/endpoint/pom.xml
deleted file mode 100644
index f1b3aba..0000000
--- a/api/common/endpoint/pom.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one or more
-  ~ contributor license agreements.  See the NOTICE file distributed with
-  ~ this work for additional information regarding copyright ownership.
-  ~ The ASF licenses this file to You under the Apache License, Version 2.0
-  ~ (the "License"); you may not use this file except in compliance with
-  ~ the License.  You may obtain a copy of the License at
-  ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.servicecomb.fence</groupId>
-    <artifactId>authentication-common-api</artifactId>
-    <version>0.0.1-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>authentication-common-api-endpoint</artifactId>
-  <packaging>jar</packaging>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.servicecomb.fence</groupId>
-      <artifactId>authentication-common-api-service</artifactId>
-      <version>${project.parent.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework.boot</groupId>
-      <artifactId>spring-boot-autoconfigure</artifactId>
-    </dependency>
-  </dependencies>
-</project>
diff --git a/api/common/endpoint/src/main/java/org/apache/servicecomb/fence/token/TokenStoreConfiguration.java b/api/common/endpoint/src/main/java/org/apache/servicecomb/fence/token/TokenStoreConfiguration.java
deleted file mode 100644
index b5a1f79..0000000
--- a/api/common/endpoint/src/main/java/org/apache/servicecomb/fence/token/TokenStoreConfiguration.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.servicecomb.fence.token;
-
-import org.apache.servicecomb.fence.util.CommonConstants;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.security.jwt.crypto.sign.Signer;
-import org.springframework.security.jwt.crypto.sign.SignerVerifier;
-
-@Configuration
-public class TokenStoreConfiguration {
-  @Bean(name = {CommonConstants.BEAN_AUTH_ACCESS_TOKEN_STORE,
-      CommonConstants.BEAN_AUTH_REFRESH_TOKEN_STORE})
-  @ConditionalOnMissingBean
-  public SessionTokenStore sessionTokenStore() {
-    return new SessionTokenStore();
-  }
-
-  @Bean(name = {CommonConstants.BEAN_AUTH_ID_TOKEN_STORE})
-  @ConditionalOnMissingBean
-  public JWTTokenStore jwtTokenStore(@Autowired @Qualifier(CommonConstants.BEAN_AUTH_SIGNER) Signer signer,
-      @Autowired @Qualifier(CommonConstants.BEAN_AUTH_SIGNATURE_VERIFIER) SignerVerifier signerVerifier) {
-    return new JWTTokenStoreImpl(signer, signerVerifier);
-  }
-}
diff --git a/api/common/pom.xml b/api/common/pom.xml
deleted file mode 100644
index 9584a88..0000000
--- a/api/common/pom.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one or more
-  ~ contributor license agreements.  See the NOTICE file distributed with
-  ~ this work for additional information regarding copyright ownership.
-  ~ The ASF licenses this file to You under the Apache License, Version 2.0
-  ~ (the "License"); you may not use this file except in compliance with
-  ~ the License.  You may obtain a copy of the License at
-  ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.servicecomb.fence</groupId>
-    <artifactId>authentication-api</artifactId>
-    <version>0.0.1-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>authentication-common-api</artifactId>
-  <packaging>pom</packaging>
-
-  <modules>
-    <module>service</module>
-    <module>endpoint</module>
-  </modules>
-</project>
\ No newline at end of file
diff --git a/api/common/service/pom.xml b/api/common/service/pom.xml
deleted file mode 100644
index 660db15..0000000
--- a/api/common/service/pom.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one or more
-  ~ contributor license agreements.  See the NOTICE file distributed with
-  ~ this work for additional information regarding copyright ownership.
-  ~ The ASF licenses this file to You under the Apache License, Version 2.0
-  ~ (the "License"); you may not use this file except in compliance with
-  ~ the License.  You may obtain a copy of the License at
-  ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.servicecomb.fence</groupId>
-    <artifactId>authentication-common-api</artifactId>
-    <version>0.0.1-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>authentication-common-api-service</artifactId>
-  <packaging>jar</packaging>
-
- <dependencyManagement>
-    <dependencies>
-      <dependency>
-        <groupId>org.springframework.security.oauth</groupId>
-        <artifactId>spring-security-oauth2</artifactId>
-        <version>2.3.6.RELEASE</version>
-      </dependency>
-      <dependency>
-        <groupId>org.springframework.security</groupId>
-        <artifactId>spring-security-jwt</artifactId>
-        <version>1.0.7.RELEASE</version>
-      </dependency>
-    </dependencies>
-  </dependencyManagement>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.springframework.security.oauth</groupId>
-      <artifactId>spring-security-oauth2</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework.security</groupId>
-      <artifactId>spring-security-jwt</artifactId>
-    </dependency>
-  </dependencies>
-</project>
diff --git a/api/edge-service/endpoint/pom.xml b/api/edge-service/endpoint/pom.xml
deleted file mode 100644
index c488b4f..0000000
--- a/api/edge-service/endpoint/pom.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- ~ Licensed to the Apache Software Foundation (ASF) under one or more 
-  ~ contributor license agreements. See the NOTICE file distributed with ~ 
-  this work for additional information regarding copyright ownership. ~ The 
-  ASF licenses this file to You under the Apache License, Version 2.0 ~ (the 
-  "License"); you may not use this file except in compliance with ~ the License. 
-  You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 
-  ~ ~ Unless required by applicable law or agreed to in writing, software ~ 
-  distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT 
-  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the 
-  License for the specific language governing permissions and ~ limitations 
-  under the License. -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.servicecomb.fence</groupId>
-    <artifactId>authentication-edge-api</artifactId>
-    <version>0.0.1-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>authentication-edge-api-endpoint</artifactId>
-  <packaging>jar</packaging>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.servicecomb.fence</groupId>
-      <artifactId>authentication-common-api-endpoint</artifactId>
-      <version>${project.parent.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.servicecomb.fence</groupId>
-      <artifactId>authentication-edge-api-service</artifactId>
-      <version>${project.parent.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.servicecomb.fence</groupId>
-      <artifactId>authentication-server-api-service</artifactId>
-      <version>${project.parent.version}</version>
-    </dependency>
-  </dependencies>
-</project>
diff --git a/api/edge-service/endpoint/src/main/java/org/apache/servicecomb/fence/edge/EdgeConfiguration.java b/api/edge-service/endpoint/src/main/java/org/apache/servicecomb/fence/edge/EdgeConfiguration.java
deleted file mode 100644
index 086919b..0000000
--- a/api/edge-service/endpoint/src/main/java/org/apache/servicecomb/fence/edge/EdgeConfiguration.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.servicecomb.fence.edge;
-
-import org.springframework.context.annotation.Configuration;
-
-@Configuration
-public class EdgeConfiguration {
-
-}
diff --git a/api/edge-service/pom.xml b/api/edge-service/pom.xml
deleted file mode 100644
index 534cd15..0000000
--- a/api/edge-service/pom.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one or more
-  ~ contributor license agreements.  See the NOTICE file distributed with
-  ~ this work for additional information regarding copyright ownership.
-  ~ The ASF licenses this file to You under the Apache License, Version 2.0
-  ~ (the "License"); you may not use this file except in compliance with
-  ~ the License.  You may obtain a copy of the License at
-  ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.servicecomb.fence</groupId>
-    <artifactId>authentication-api</artifactId>
-    <version>0.0.1-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>authentication-edge-api</artifactId>
-  <packaging>pom</packaging>
-
-  <modules>
-    <module>service</module>
-    <module>endpoint</module>
-  </modules>
-</project>
\ No newline at end of file
diff --git a/api/edge-service/service/pom.xml b/api/edge-service/service/pom.xml
deleted file mode 100644
index 7d4f451..0000000
--- a/api/edge-service/service/pom.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- ~ Licensed to the Apache Software Foundation (ASF) under one or more 
-  ~ contributor license agreements. See the NOTICE file distributed with ~ 
-  this work for additional information regarding copyright ownership. ~ The 
-  ASF licenses this file to You under the Apache License, Version 2.0 ~ (the 
-  "License"); you may not use this file except in compliance with ~ the License. 
-  You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 
-  ~ ~ Unless required by applicable law or agreed to in writing, software ~ 
-  distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT 
-  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the 
-  License for the specific language governing permissions and ~ limitations 
-  under the License. -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.servicecomb.fence</groupId>
-    <artifactId>authentication-edge-api</artifactId>
-    <version>0.0.1-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>authentication-edge-api-service</artifactId>
-  <packaging>jar</packaging>
-
-  <dependencyManagement>
-    <dependencies>
-      <dependency>
-        <groupId>org.apache.servicecomb.fence</groupId>
-        <artifactId>authentication-common-api-endpoint</artifactId>
-        <version>0.0.1-SNAPSHOT</version>
-      </dependency>
-    </dependencies>
-  </dependencyManagement>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.servicecomb.fence</groupId>
-      <artifactId>authentication-server-api-service</artifactId>
-      <version>${project.parent.version}</version>
-    </dependency>
-  </dependencies>
-</project>
diff --git a/api/pom.xml b/api/pom.xml
deleted file mode 100644
index 7b77e63..0000000
--- a/api/pom.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one or more
-  ~ contributor license agreements.  See the NOTICE file distributed with
-  ~ this work for additional information regarding copyright ownership.
-  ~ The ASF licenses this file to You under the Apache License, Version 2.0
-  ~ (the "License"); you may not use this file except in compliance with
-  ~ the License.  You may obtain a copy of the License at
-  ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.servicecomb.fence</groupId>
-    <artifactId>project-fence</artifactId>
-    <version>0.0.1-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>authentication-api</artifactId>
-  <packaging>pom</packaging>
-
-  <properties>
-    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-  </properties>
-
-  <modules>
-    <module>common</module>
-    <module>authentication-server</module>
-    <module>resource-server</module>
-    <module>edge-service</module>
-  </modules>
-</project>
\ No newline at end of file
diff --git a/api/resource-server/pom.xml b/api/resource-server/pom.xml
deleted file mode 100644
index 63f6ce3..0000000
--- a/api/resource-server/pom.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one or more
-  ~ contributor license agreements.  See the NOTICE file distributed with
-  ~ this work for additional information regarding copyright ownership.
-  ~ The ASF licenses this file to You under the Apache License, Version 2.0
-  ~ (the "License"); you may not use this file except in compliance with
-  ~ the License.  You may obtain a copy of the License at
-  ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.servicecomb.fence</groupId>
-    <artifactId>authentication-api</artifactId>
-    <version>0.0.1-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>authentication-resource-api</artifactId>
-  <packaging>pom</packaging>
-
-  <modules>
-    <module>service</module>
-    <module>endpoint</module>
-  </modules>
-</project>
\ No newline at end of file
diff --git a/api/resource-server/service/pom.xml b/api/resource-server/service/pom.xml
deleted file mode 100644
index cfc6a26..0000000
--- a/api/resource-server/service/pom.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- ~ Licensed to the Apache Software Foundation (ASF) under one or more 
-  ~ contributor license agreements. See the NOTICE file distributed with ~ 
-  this work for additional information regarding copyright ownership. ~ The 
-  ASF licenses this file to You under the Apache License, Version 2.0 ~ (the 
-  "License"); you may not use this file except in compliance with ~ the License. 
-  You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 
-  ~ ~ Unless required by applicable law or agreed to in writing, software ~ 
-  distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT 
-  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the 
-  License for the specific language governing permissions and ~ limitations 
-  under the License. -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.servicecomb.fence</groupId>
-    <artifactId>authentication-resource-api</artifactId>
-    <version>0.0.1-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>authentication-resource-api-service</artifactId>
-  <packaging>jar</packaging>
-
-  <dependencyManagement>
-    <dependencies>
-      <dependency>
-        <groupId>org.apache.servicecomb.fence</groupId>
-        <artifactId>authentication-common-api-endpoint</artifactId>
-        <version>0.0.1-SNAPSHOT</version>
-      </dependency>
-    </dependencies>
-  </dependencyManagement>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.servicecomb.fence</groupId>
-      <artifactId>authentication-common-api-endpoint</artifactId>
-    </dependency>
-  </dependencies>
-</project>
diff --git a/authentication-server/pom.xml b/authentication-server/pom.xml
index 3ae4d9f..13f93a0 100644
--- a/authentication-server/pom.xml
+++ b/authentication-server/pom.xml
@@ -28,48 +28,13 @@
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   </properties>
 
-  <dependencyManagement>
-    <dependencies>
-      <dependency>
-        <groupId>org.mybatis</groupId>
-        <artifactId>mybatis</artifactId>
-        <version>3.5.6</version>
-      </dependency>
-      <dependency>
-        <groupId>org.mybatis</groupId>
-        <artifactId>mybatis-spring</artifactId>
-        <version>1.3.0</version>
-      </dependency>
-      <dependency>
-        <groupId>mysql</groupId>
-        <artifactId>mysql-connector-java</artifactId>
-        <version>8.0.28</version>
-      </dependency>
-      <dependency>
-        <groupId>org.apache.servicecomb.fence</groupId>
-        <artifactId>authentication-server-api-endpoint</artifactId>
-        <version>0.0.1-SNAPSHOT</version>
-      </dependency>
-      <dependency>
-        <groupId>org.apache.servicecomb.fence</groupId>
-        <artifactId>authentication-common-api-endpoint</artifactId>
-        <version>0.0.1-SNAPSHOT</version>
-      </dependency>
-      <dependency>
-        <groupId>org.springframework.security.oauth</groupId>
-        <artifactId>spring-security-oauth2</artifactId>
-        <version>2.3.6.RELEASE</version>
-      </dependency>
-      <dependency>
-        <groupId>org.springframework.security</groupId>
-        <artifactId>spring-security-jwt</artifactId>
-        <version>1.0.7.RELEASE</version>
-      </dependency>
-    </dependencies>
-  </dependencyManagement>
-
   <dependencies>
     <dependency>
+      <groupId>org.apache.servicecomb.fence</groupId>
+      <artifactId>fence-common</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
       <groupId>org.springframework.security.oauth</groupId>
       <artifactId>spring-security-oauth2</artifactId>
     </dependency>
@@ -78,14 +43,6 @@
       <artifactId>spring-security-jwt</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.servicecomb.fence</groupId>
-      <artifactId>authentication-common-api-endpoint</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.servicecomb.fence</groupId>
-      <artifactId>authentication-server-api-endpoint</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.apache.servicecomb</groupId>
       <artifactId>solution-basic</artifactId>
     </dependency>
diff --git a/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/AuthenticationConfiguration.java b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/AuthenticationConfiguration.java
index 95d1159..f89bf7c 100644
--- a/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/AuthenticationConfiguration.java
+++ b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/AuthenticationConfiguration.java
@@ -17,12 +17,18 @@
 
 package org.apache.servicecomb.fence.authentication;
 
+import org.apache.servicecomb.fence.token.JWTTokenStore;
+import org.apache.servicecomb.fence.token.JWTTokenStoreImpl;
+import org.apache.servicecomb.fence.token.SessionTokenStore;
 import org.apache.servicecomb.fence.util.CommonConstants;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.security.crypto.password.PasswordEncoder;
 import org.springframework.security.crypto.password.Pbkdf2PasswordEncoder;
 import org.springframework.security.jwt.crypto.sign.MacSigner;
+import org.springframework.security.jwt.crypto.sign.Signer;
 import org.springframework.security.jwt.crypto.sign.SignerVerifier;
 
 @Configuration
@@ -38,4 +44,16 @@
     // If using MacSigner, need to protect the shared key by properly encryption.
     return new MacSigner("Please change this key.");
   }
+
+  @Bean(name = {CommonConstants.BEAN_AUTH_ID_TOKEN_STORE})
+  public JWTTokenStore jwtTokenStore(@Autowired @Qualifier(CommonConstants.BEAN_AUTH_SIGNER) Signer signer,
+      @Autowired @Qualifier(CommonConstants.BEAN_AUTH_SIGNATURE_VERIFIER) SignerVerifier signerVerifier) {
+    return new JWTTokenStoreImpl(signer, signerVerifier);
+  }
+
+  @Bean(name = {CommonConstants.BEAN_AUTH_ACCESS_TOKEN_STORE,
+      CommonConstants.BEAN_AUTH_REFRESH_TOKEN_STORE})
+  public SessionTokenStore sessionTokenStore() {
+    return new SessionTokenStore();
+  }
 }
diff --git a/api/authentication-server/service/src/main/java/org/apache/servicecomb/fence/server/AuthenticationServerConstants.java b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/AuthenticationServerConstants.java
similarity index 97%
rename from api/authentication-server/service/src/main/java/org/apache/servicecomb/fence/server/AuthenticationServerConstants.java
rename to authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/AuthenticationServerConstants.java
index 02ac78b..de1370c 100644
--- a/api/authentication-server/service/src/main/java/org/apache/servicecomb/fence/server/AuthenticationServerConstants.java
+++ b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/AuthenticationServerConstants.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.fence.server;
+package org.apache.servicecomb.fence.authentication;
 
 public class AuthenticationServerConstants {
   public static final String PARAM_GRANT_TYPE = "grant_type";
diff --git a/api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/GithubAccessTokenResponse.java b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/GithubAccessTokenResponse.java
similarity index 96%
rename from api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/GithubAccessTokenResponse.java
rename to authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/GithubAccessTokenResponse.java
index ce854f1..9503e35 100644
--- a/api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/GithubAccessTokenResponse.java
+++ b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/GithubAccessTokenResponse.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.servicecomb.fence.server;
+package org.apache.servicecomb.fence.authentication;
 
 // see: https://developer.github.com/apps/building-oauth-apps/authorizing-oauth-apps/
 public class GithubAccessTokenResponse {
diff --git a/api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/GithubDynamicProperties.java b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/GithubDynamicProperties.java
similarity index 96%
rename from api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/GithubDynamicProperties.java
rename to authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/GithubDynamicProperties.java
index 25f4aab..8d05642 100644
--- a/api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/GithubDynamicProperties.java
+++ b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/GithubDynamicProperties.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.fence.server;
+package org.apache.servicecomb.fence.authentication;
 
 import org.apache.servicecomb.config.inject.InjectProperties;
 import org.apache.servicecomb.config.inject.InjectProperty;
diff --git a/api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/GithubDynamicPropertiesManager.java b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/GithubDynamicPropertiesManager.java
similarity index 95%
rename from api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/GithubDynamicPropertiesManager.java
rename to authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/GithubDynamicPropertiesManager.java
index a8945a7..475a3fa 100644
--- a/api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/GithubDynamicPropertiesManager.java
+++ b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/GithubDynamicPropertiesManager.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.fence.server;
+package org.apache.servicecomb.fence.authentication;
 
 import java.util.Map;
 
diff --git a/api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/GithubOAuthService.java b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/GithubOAuthService.java
similarity index 96%
rename from api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/GithubOAuthService.java
rename to authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/GithubOAuthService.java
index 6a82fa0..108aff6 100644
--- a/api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/GithubOAuthService.java
+++ b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/GithubOAuthService.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.fence.server;
+package org.apache.servicecomb.fence.authentication;
 
 import javax.ws.rs.FormParam;
 import javax.ws.rs.POST;
diff --git a/api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/GithubOAuthServiceRegister.java b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/GithubOAuthServiceRegister.java
similarity index 95%
rename from api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/GithubOAuthServiceRegister.java
rename to authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/GithubOAuthServiceRegister.java
index cc30c12..f9a232a 100644
--- a/api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/GithubOAuthServiceRegister.java
+++ b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/GithubOAuthServiceRegister.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.fence.server;
+package org.apache.servicecomb.fence.authentication;
 
 import org.apache.servicecomb.provider.pojo.registry.ThirdServiceWithInvokerRegister;
 import org.springframework.stereotype.Component;
diff --git a/api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/GithubTokenGranter.java b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/GithubTokenGranter.java
similarity index 98%
rename from api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/GithubTokenGranter.java
rename to authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/GithubTokenGranter.java
index b59248e..e3a7473 100644
--- a/api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/GithubTokenGranter.java
+++ b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/GithubTokenGranter.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.fence.server;
+package org.apache.servicecomb.fence.authentication;
 
 import org.apache.commons.lang3.StringUtils;
 import org.apache.servicecomb.fence.token.AbstractOpenIDTokenStore;
diff --git a/api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/PasswordTokenGranter.java b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/PasswordTokenGranter.java
similarity index 97%
rename from api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/PasswordTokenGranter.java
rename to authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/PasswordTokenGranter.java
index 839054c..a2f90a9 100644
--- a/api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/PasswordTokenGranter.java
+++ b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/PasswordTokenGranter.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.fence.server;
+package org.apache.servicecomb.fence.authentication;
 
 import java.util.Map;
 
diff --git a/api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/RefreshTokenTokenGranter.java b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/RefreshTokenTokenGranter.java
similarity index 97%
rename from api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/RefreshTokenTokenGranter.java
rename to authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/RefreshTokenTokenGranter.java
index e4b4015..3df4065 100644
--- a/api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/RefreshTokenTokenGranter.java
+++ b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/RefreshTokenTokenGranter.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.fence.server;
+package org.apache.servicecomb.fence.authentication;
 
 import java.util.Map;
 
diff --git a/api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/ThirdPartyProviderEndpoint.java b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/ThirdPartyProviderEndpoint.java
similarity index 97%
rename from api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/ThirdPartyProviderEndpoint.java
rename to authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/ThirdPartyProviderEndpoint.java
index 27a6ef6..853d4b3 100644
--- a/api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/ThirdPartyProviderEndpoint.java
+++ b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/ThirdPartyProviderEndpoint.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.fence.server;
+package org.apache.servicecomb.fence.authentication;
 
 import java.util.List;
 
diff --git a/api/authentication-server/service/src/main/java/org/apache/servicecomb/fence/server/ThirdPartyProviderService.java b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/ThirdPartyProviderService.java
similarity index 94%
rename from api/authentication-server/service/src/main/java/org/apache/servicecomb/fence/server/ThirdPartyProviderService.java
rename to authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/ThirdPartyProviderService.java
index b278e94..1f101ab 100644
--- a/api/authentication-server/service/src/main/java/org/apache/servicecomb/fence/server/ThirdPartyProviderService.java
+++ b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/ThirdPartyProviderService.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.fence.server;
+package org.apache.servicecomb.fence.authentication;
 
 /**
  * Connecting third party oAuth providers
diff --git a/api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/ThirdPartyTokenGranter.java b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/ThirdPartyTokenGranter.java
similarity index 96%
rename from api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/ThirdPartyTokenGranter.java
rename to authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/ThirdPartyTokenGranter.java
index 2060a4f..63dcfb6 100644
--- a/api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/ThirdPartyTokenGranter.java
+++ b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/ThirdPartyTokenGranter.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.fence.server;
+package org.apache.servicecomb.fence.authentication;
 
 import java.util.Map;
 
diff --git a/api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/TokenEndpoint.java b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/TokenEndpoint.java
similarity index 97%
rename from api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/TokenEndpoint.java
rename to authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/TokenEndpoint.java
index e6a36d1..da4c30b 100644
--- a/api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/TokenEndpoint.java
+++ b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/TokenEndpoint.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.fence.server;
+package org.apache.servicecomb.fence.authentication;
 
 import java.util.List;
 import java.util.Map;
diff --git a/api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/TokenGranter.java b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/TokenGranter.java
similarity index 95%
rename from api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/TokenGranter.java
rename to authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/TokenGranter.java
index 5db979c..f1cd492 100644
--- a/api/authentication-server/endpoint/src/main/java/org/apache/servicecomb/fence/server/TokenGranter.java
+++ b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/TokenGranter.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.fence.server;
+package org.apache.servicecomb.fence.authentication;
 
 import java.util.Map;
 
diff --git a/api/authentication-server/service/src/main/java/org/apache/servicecomb/fence/server/TokenService.java b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/TokenService.java
similarity index 94%
rename from api/authentication-server/service/src/main/java/org/apache/servicecomb/fence/server/TokenService.java
rename to authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/TokenService.java
index 7827335..457c1be 100644
--- a/api/authentication-server/service/src/main/java/org/apache/servicecomb/fence/server/TokenService.java
+++ b/authentication-server/src/main/java/org/apache/servicecomb/fence/authentication/TokenService.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.fence.server;
+package org.apache.servicecomb.fence.authentication;
 
 import java.util.Map;
 
diff --git a/authentication-server/src/main/resources/microservice.yaml b/authentication-server/src/main/resources/microservice.yaml
index a46cddc..c70cea8 100644
--- a/authentication-server/src/main/resources/microservice.yaml
+++ b/authentication-server/src/main/resources/microservice.yaml
@@ -59,3 +59,6 @@
 db:
   password: root # WARNING: please change password in production environment
 
+GithubOAuthService:
+  urls:
+    - rest://github.com:443?sslEnabled=true
diff --git a/build_and_run.bat b/build_and_run.bat
index 2ce3a2a..ee4469e 100644
--- a/build_and_run.bat
+++ b/build_and_run.bat
@@ -8,12 +8,18 @@
 cd %HOME%\authentication-server\target
 start java -jar authentication-server-0.0.1-SNAPSHOT.jar
 
+timeout /T 3 /NOBREAK
+
 cd %HOME%\edge-service\target
 start java -jar edge-service-0.0.1-SNAPSHOT.jar
 
+timeout /T 3 /NOBREAK
+
 cd %HOME%\resource-server\target
 start java -jar resource-server-0.0.1-SNAPSHOT.jar
 
+timeout /T 3 /NOBREAK
+
 cd %HOME%\integration-tests\target
 start java -jar integration-tests-0.0.1-SNAPSHOT.jar
 
diff --git a/api/resource-server/endpoint/pom.xml b/common/pom.xml
similarity index 79%
rename from api/resource-server/endpoint/pom.xml
rename to common/pom.xml
index 543180c..14054fc 100644
--- a/api/resource-server/endpoint/pom.xml
+++ b/common/pom.xml
@@ -15,24 +15,29 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License.
   -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
 
   <parent>
     <groupId>org.apache.servicecomb.fence</groupId>
-    <artifactId>authentication-resource-api</artifactId>
+    <artifactId>project-fence</artifactId>
     <version>0.0.1-SNAPSHOT</version>
   </parent>
 
-  <artifactId>authentication-resource-api-endpoint</artifactId>
+  <artifactId>fence-common</artifactId>
   <packaging>jar</packaging>
 
   <dependencies>
     <dependency>
-      <groupId>org.apache.servicecomb.fence</groupId>
-      <artifactId>authentication-resource-api-service</artifactId>
-      <version>${project.parent.version}</version>
+      <groupId>org.springframework.security.oauth</groupId>
+      <artifactId>spring-security-oauth2</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.security</groupId>
+      <artifactId>spring-security-jwt</artifactId>
     </dependency>
   </dependencies>
-</project>
+
+</project>
\ No newline at end of file
diff --git a/api/common/service/src/main/java/org/apache/servicecomb/fence/jwt/JWTClaims.java b/common/src/main/java/org/apache/servicecomb/fence/jwt/JWTClaims.java
similarity index 100%
rename from api/common/service/src/main/java/org/apache/servicecomb/fence/jwt/JWTClaims.java
rename to common/src/main/java/org/apache/servicecomb/fence/jwt/JWTClaims.java
diff --git a/api/common/service/src/main/java/org/apache/servicecomb/fence/jwt/JWTClaimsCommon.java b/common/src/main/java/org/apache/servicecomb/fence/jwt/JWTClaimsCommon.java
similarity index 100%
rename from api/common/service/src/main/java/org/apache/servicecomb/fence/jwt/JWTClaimsCommon.java
rename to common/src/main/java/org/apache/servicecomb/fence/jwt/JWTClaimsCommon.java
diff --git a/api/common/service/src/main/java/org/apache/servicecomb/fence/jwt/JWTHeader.java b/common/src/main/java/org/apache/servicecomb/fence/jwt/JWTHeader.java
similarity index 100%
rename from api/common/service/src/main/java/org/apache/servicecomb/fence/jwt/JWTHeader.java
rename to common/src/main/java/org/apache/servicecomb/fence/jwt/JWTHeader.java
diff --git a/api/common/service/src/main/java/org/apache/servicecomb/fence/jwt/JsonParser.java b/common/src/main/java/org/apache/servicecomb/fence/jwt/JsonParser.java
similarity index 100%
rename from api/common/service/src/main/java/org/apache/servicecomb/fence/jwt/JsonParser.java
rename to common/src/main/java/org/apache/servicecomb/fence/jwt/JsonParser.java
diff --git a/api/common/service/src/main/java/org/apache/servicecomb/fence/token/AbstractOpenIDTokenStore.java b/common/src/main/java/org/apache/servicecomb/fence/token/AbstractOpenIDTokenStore.java
similarity index 100%
rename from api/common/service/src/main/java/org/apache/servicecomb/fence/token/AbstractOpenIDTokenStore.java
rename to common/src/main/java/org/apache/servicecomb/fence/token/AbstractOpenIDTokenStore.java
diff --git a/api/common/service/src/main/java/org/apache/servicecomb/fence/token/InMemoryOpenIDTokenStore.java b/common/src/main/java/org/apache/servicecomb/fence/token/InMemoryOpenIDTokenStore.java
similarity index 100%
rename from api/common/service/src/main/java/org/apache/servicecomb/fence/token/InMemoryOpenIDTokenStore.java
rename to common/src/main/java/org/apache/servicecomb/fence/token/InMemoryOpenIDTokenStore.java
diff --git a/api/common/service/src/main/java/org/apache/servicecomb/fence/token/JWTToken.java b/common/src/main/java/org/apache/servicecomb/fence/token/JWTToken.java
similarity index 100%
rename from api/common/service/src/main/java/org/apache/servicecomb/fence/token/JWTToken.java
rename to common/src/main/java/org/apache/servicecomb/fence/token/JWTToken.java
diff --git a/api/common/service/src/main/java/org/apache/servicecomb/fence/token/JWTTokenStore.java b/common/src/main/java/org/apache/servicecomb/fence/token/JWTTokenStore.java
similarity index 100%
rename from api/common/service/src/main/java/org/apache/servicecomb/fence/token/JWTTokenStore.java
rename to common/src/main/java/org/apache/servicecomb/fence/token/JWTTokenStore.java
diff --git a/api/common/service/src/main/java/org/apache/servicecomb/fence/token/JWTTokenStoreImpl.java b/common/src/main/java/org/apache/servicecomb/fence/token/JWTTokenStoreImpl.java
similarity index 100%
rename from api/common/service/src/main/java/org/apache/servicecomb/fence/token/JWTTokenStoreImpl.java
rename to common/src/main/java/org/apache/servicecomb/fence/token/JWTTokenStoreImpl.java
diff --git a/api/common/service/src/main/java/org/apache/servicecomb/fence/token/OpenIDToken.java b/common/src/main/java/org/apache/servicecomb/fence/token/OpenIDToken.java
similarity index 100%
rename from api/common/service/src/main/java/org/apache/servicecomb/fence/token/OpenIDToken.java
rename to common/src/main/java/org/apache/servicecomb/fence/token/OpenIDToken.java
diff --git a/api/common/service/src/main/java/org/apache/servicecomb/fence/token/OpenIDTokenStore.java b/common/src/main/java/org/apache/servicecomb/fence/token/OpenIDTokenStore.java
similarity index 100%
rename from api/common/service/src/main/java/org/apache/servicecomb/fence/token/OpenIDTokenStore.java
rename to common/src/main/java/org/apache/servicecomb/fence/token/OpenIDTokenStore.java
diff --git a/api/common/service/src/main/java/org/apache/servicecomb/fence/token/SessionToken.java b/common/src/main/java/org/apache/servicecomb/fence/token/SessionToken.java
similarity index 100%
rename from api/common/service/src/main/java/org/apache/servicecomb/fence/token/SessionToken.java
rename to common/src/main/java/org/apache/servicecomb/fence/token/SessionToken.java
diff --git a/api/common/service/src/main/java/org/apache/servicecomb/fence/token/SessionTokenStore.java b/common/src/main/java/org/apache/servicecomb/fence/token/SessionTokenStore.java
similarity index 100%
rename from api/common/service/src/main/java/org/apache/servicecomb/fence/token/SessionTokenStore.java
rename to common/src/main/java/org/apache/servicecomb/fence/token/SessionTokenStore.java
diff --git a/api/common/service/src/main/java/org/apache/servicecomb/fence/token/Token.java b/common/src/main/java/org/apache/servicecomb/fence/token/Token.java
similarity index 100%
rename from api/common/service/src/main/java/org/apache/servicecomb/fence/token/Token.java
rename to common/src/main/java/org/apache/servicecomb/fence/token/Token.java
diff --git a/api/common/service/src/main/java/org/apache/servicecomb/fence/token/TokenDynamicProperties.java b/common/src/main/java/org/apache/servicecomb/fence/token/TokenDynamicProperties.java
similarity index 100%
rename from api/common/service/src/main/java/org/apache/servicecomb/fence/token/TokenDynamicProperties.java
rename to common/src/main/java/org/apache/servicecomb/fence/token/TokenDynamicProperties.java
diff --git a/api/common/service/src/main/java/org/apache/servicecomb/fence/token/TokenDynamicPropertiesManager.java b/common/src/main/java/org/apache/servicecomb/fence/token/TokenDynamicPropertiesManager.java
similarity index 100%
rename from api/common/service/src/main/java/org/apache/servicecomb/fence/token/TokenDynamicPropertiesManager.java
rename to common/src/main/java/org/apache/servicecomb/fence/token/TokenDynamicPropertiesManager.java
diff --git a/api/common/service/src/main/java/org/apache/servicecomb/fence/token/TokenStore.java b/common/src/main/java/org/apache/servicecomb/fence/token/TokenStore.java
similarity index 100%
rename from api/common/service/src/main/java/org/apache/servicecomb/fence/token/TokenStore.java
rename to common/src/main/java/org/apache/servicecomb/fence/token/TokenStore.java
diff --git a/api/common/service/src/main/java/org/apache/servicecomb/fence/util/CommonConstants.java b/common/src/main/java/org/apache/servicecomb/fence/util/CommonConstants.java
similarity index 100%
rename from api/common/service/src/main/java/org/apache/servicecomb/fence/util/CommonConstants.java
rename to common/src/main/java/org/apache/servicecomb/fence/util/CommonConstants.java
diff --git a/edge-service/pom.xml b/edge-service/pom.xml
index 00fc3ca..0f46cde 100644
--- a/edge-service/pom.xml
+++ b/edge-service/pom.xml
@@ -28,25 +28,11 @@
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   </properties>
 
-  <dependencyManagement>
-    <dependencies>
-      <dependency>
-        <groupId>org.apache.servicecomb.fence</groupId>
-        <artifactId>authentication-edge-api-endpoint</artifactId>
-        <version>0.0.1-SNAPSHOT</version>
-      </dependency>
-      <dependency>
-        <groupId>org.apache.servicecomb.fence</groupId>
-        <artifactId>authentication-server-api-service</artifactId>
-        <version>0.0.1-SNAPSHOT</version>
-      </dependency>
-    </dependencies>
-  </dependencyManagement>
-
   <dependencies>
     <dependency>
       <groupId>org.apache.servicecomb.fence</groupId>
-      <artifactId>authentication-edge-api-endpoint</artifactId>
+      <artifactId>fence-common</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.servicecomb</groupId>
diff --git a/api/edge-service/endpoint/src/main/java/org/apache/servicecomb/fence/edge/AuthHandler.java b/edge-service/src/main/java/org/apache/servicecomb/fence/edge/AuthHandler.java
similarity index 100%
rename from api/edge-service/endpoint/src/main/java/org/apache/servicecomb/fence/edge/AuthHandler.java
rename to edge-service/src/main/java/org/apache/servicecomb/fence/edge/AuthHandler.java
diff --git a/edge-service/src/main/java/org/apache/servicecomb/fence/edge/AuthenticationConfiguration.java b/edge-service/src/main/java/org/apache/servicecomb/fence/edge/AuthenticationConfiguration.java
index 3ebd4b8..d65e7b1 100644
--- a/edge-service/src/main/java/org/apache/servicecomb/fence/edge/AuthenticationConfiguration.java
+++ b/edge-service/src/main/java/org/apache/servicecomb/fence/edge/AuthenticationConfiguration.java
@@ -19,6 +19,7 @@
 
 import org.apache.servicecomb.fence.token.JWTTokenStore;
 import org.apache.servicecomb.fence.token.JWTTokenStoreImpl;
+import org.apache.servicecomb.fence.token.SessionTokenStore;
 import org.apache.servicecomb.fence.util.CommonConstants;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
@@ -38,9 +39,14 @@
   }
 
   @Bean(name = CommonConstants.BEAN_AUTH_ID_TOKEN_STORE)
-  public JWTTokenStore authIDTokenStore(@Autowired @Qualifier(CommonConstants.BEAN_AUTH_SIGNER) Signer signer, 
+  public JWTTokenStore authIDTokenStore(@Autowired @Qualifier(CommonConstants.BEAN_AUTH_SIGNER) Signer signer,
       @Autowired @Qualifier(CommonConstants.BEAN_AUTH_SIGNATURE_VERIFIER) SignerVerifier signerVerifier) {
     return new JWTTokenStoreImpl(signer, signerVerifier);
   }
 
+  @Bean(name = {CommonConstants.BEAN_AUTH_ACCESS_TOKEN_STORE,
+      CommonConstants.BEAN_AUTH_REFRESH_TOKEN_STORE})
+  public SessionTokenStore sessionTokenStore() {
+    return new SessionTokenStore();
+  }
 }
diff --git a/api/edge-service/endpoint/src/main/java/org/apache/servicecomb/fence/edge/AuthenticationFilter.java b/edge-service/src/main/java/org/apache/servicecomb/fence/edge/AuthenticationFilter.java
similarity index 100%
rename from api/edge-service/endpoint/src/main/java/org/apache/servicecomb/fence/edge/AuthenticationFilter.java
rename to edge-service/src/main/java/org/apache/servicecomb/fence/edge/AuthenticationFilter.java
diff --git a/api/edge-service/endpoint/src/main/java/org/apache/servicecomb/fence/edge/AuthenticationServerTokenEndpoint.java b/edge-service/src/main/java/org/apache/servicecomb/fence/edge/AuthenticationServerTokenEndpoint.java
similarity index 100%
rename from api/edge-service/endpoint/src/main/java/org/apache/servicecomb/fence/edge/AuthenticationServerTokenEndpoint.java
rename to edge-service/src/main/java/org/apache/servicecomb/fence/edge/AuthenticationServerTokenEndpoint.java
diff --git a/api/edge-service/endpoint/src/main/java/org/apache/servicecomb/fence/edge/EdgeOpenIDTokenStore.java b/edge-service/src/main/java/org/apache/servicecomb/fence/edge/EdgeOpenIDTokenStore.java
similarity index 100%
rename from api/edge-service/endpoint/src/main/java/org/apache/servicecomb/fence/edge/EdgeOpenIDTokenStore.java
rename to edge-service/src/main/java/org/apache/servicecomb/fence/edge/EdgeOpenIDTokenStore.java
diff --git a/api/edge-service/endpoint/src/main/java/org/apache/servicecomb/fence/edge/InternalAccessHandler.java b/edge-service/src/main/java/org/apache/servicecomb/fence/edge/InternalAccessHandler.java
similarity index 100%
rename from api/edge-service/endpoint/src/main/java/org/apache/servicecomb/fence/edge/InternalAccessHandler.java
rename to edge-service/src/main/java/org/apache/servicecomb/fence/edge/InternalAccessHandler.java
diff --git a/api/edge-service/endpoint/src/main/java/org/apache/servicecomb/fence/edge/TokenEndpoint.java b/edge-service/src/main/java/org/apache/servicecomb/fence/edge/TokenEndpoint.java
similarity index 100%
rename from api/edge-service/endpoint/src/main/java/org/apache/servicecomb/fence/edge/TokenEndpoint.java
rename to edge-service/src/main/java/org/apache/servicecomb/fence/edge/TokenEndpoint.java
diff --git a/api/edge-service/service/src/main/java/org/apache/servicecomb/fence/edge/TokenResponse.java b/edge-service/src/main/java/org/apache/servicecomb/fence/edge/TokenResponse.java
similarity index 100%
rename from api/edge-service/service/src/main/java/org/apache/servicecomb/fence/edge/TokenResponse.java
rename to edge-service/src/main/java/org/apache/servicecomb/fence/edge/TokenResponse.java
diff --git a/api/edge-service/service/src/main/java/org/apache/servicecomb/fence/edge/TokenService.java b/edge-service/src/main/java/org/apache/servicecomb/fence/edge/TokenService.java
similarity index 100%
rename from api/edge-service/service/src/main/java/org/apache/servicecomb/fence/edge/TokenService.java
rename to edge-service/src/main/java/org/apache/servicecomb/fence/edge/TokenService.java
diff --git a/api/edge-service/endpoint/src/main/resources/META-INF/services/org.apache.servicecomb.common.rest.filter.HttpServerFilter b/edge-service/src/main/resources/META-INF/services/org.apache.servicecomb.common.rest.filter.HttpServerFilter
similarity index 100%
rename from api/edge-service/endpoint/src/main/resources/META-INF/services/org.apache.servicecomb.common.rest.filter.HttpServerFilter
rename to edge-service/src/main/resources/META-INF/services/org.apache.servicecomb.common.rest.filter.HttpServerFilter
diff --git a/api/edge-service/endpoint/src/main/resources/config/cse.handler.xml b/edge-service/src/main/resources/config/cse.handler.xml
similarity index 100%
rename from api/edge-service/endpoint/src/main/resources/config/cse.handler.xml
rename to edge-service/src/main/resources/config/cse.handler.xml
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index 8296fe9..b8b6252 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -28,35 +28,11 @@
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   </properties>
 
-  <dependencyManagement>
-    <dependencies>
-      <dependency>
-        <groupId>org.apache.servicecomb.fence</groupId>
-        <artifactId>authentication-edge-api-service</artifactId>
-        <version>0.0.1-SNAPSHOT</version>
-      </dependency>
-      <dependency>
-        <groupId>org.mybatis</groupId>
-        <artifactId>mybatis</artifactId>
-        <version>3.5.6</version>
-      </dependency>
-      <dependency>
-        <groupId>org.mybatis</groupId>
-        <artifactId>mybatis-spring</artifactId>
-        <version>1.3.0</version>
-      </dependency>
-      <dependency>
-        <groupId>mysql</groupId>
-        <artifactId>mysql-connector-java</artifactId>
-        <version>8.0.28</version>
-      </dependency>
-    </dependencies>
-  </dependencyManagement>
-
   <dependencies>
     <dependency>
       <groupId>org.apache.servicecomb.fence</groupId>
-      <artifactId>authentication-edge-api-service</artifactId>
+      <artifactId>fence-common</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.servicecomb</groupId>
diff --git a/api/edge-service/service/src/main/java/org/apache/servicecomb/fence/edge/TokenResponse.java b/integration-tests/src/main/java/org/apache/servicecomb/fence/edge/TokenResponse.java
similarity index 100%
copy from api/edge-service/service/src/main/java/org/apache/servicecomb/fence/edge/TokenResponse.java
copy to integration-tests/src/main/java/org/apache/servicecomb/fence/edge/TokenResponse.java
diff --git a/pom.xml b/pom.xml
index 717128e..6240115 100644
--- a/pom.xml
+++ b/pom.xml
@@ -31,7 +31,7 @@
   </properties>
 
   <modules>
-    <module>api</module>
+    <module>common</module>
     <module>edge-service</module>
     <module>authentication-server</module>
     <module>resource-server</module>
@@ -47,6 +47,35 @@
         <type>pom</type>
         <scope>import</scope>
       </dependency>
+
+      <!-- spring security -->
+      <dependency>
+        <groupId>org.springframework.security.oauth</groupId>
+        <artifactId>spring-security-oauth2</artifactId>
+        <version>2.3.6.RELEASE</version>
+      </dependency>
+      <dependency>
+        <groupId>org.springframework.security</groupId>
+        <artifactId>spring-security-jwt</artifactId>
+        <version>1.0.7.RELEASE</version>
+      </dependency>
+
+      <!-- mybatis -->
+      <dependency>
+        <groupId>org.mybatis</groupId>
+        <artifactId>mybatis</artifactId>
+        <version>3.5.6</version>
+      </dependency>
+      <dependency>
+        <groupId>org.mybatis</groupId>
+        <artifactId>mybatis-spring</artifactId>
+        <version>1.3.0</version>
+      </dependency>
+      <dependency>
+        <groupId>mysql</groupId>
+        <artifactId>mysql-connector-java</artifactId>
+        <version>5.1.46</version>
+      </dependency>
     </dependencies>
   </dependencyManagement>
 
@@ -102,4 +131,4 @@
       </plugins>
     </pluginManagement>
   </build>
-</project>
\ No newline at end of file
+</project>
diff --git a/resource-server/pom.xml b/resource-server/pom.xml
index e4a45ba..62cc64f 100644
--- a/resource-server/pom.xml
+++ b/resource-server/pom.xml
@@ -29,35 +29,11 @@
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   </properties>
 
-  <dependencyManagement>
-    <dependencies>
-      <dependency>
-        <groupId>org.apache.servicecomb.fence</groupId>
-        <artifactId>authentication-resource-api-endpoint</artifactId>
-        <version>0.0.1-SNAPSHOT</version>
-      </dependency>
-      <dependency>
-        <groupId>org.mybatis</groupId>
-        <artifactId>mybatis</artifactId>
-        <version>3.5.6</version>
-      </dependency>
-      <dependency>
-        <groupId>org.mybatis</groupId>
-        <artifactId>mybatis-spring</artifactId>
-        <version>1.3.0</version>
-      </dependency>
-      <dependency>
-        <groupId>mysql</groupId>
-        <artifactId>mysql-connector-java</artifactId>
-        <version>5.1.46</version>
-      </dependency>
-    </dependencies>
-  </dependencyManagement>
-
   <dependencies>
     <dependency>
       <groupId>org.apache.servicecomb.fence</groupId>
-      <artifactId>authentication-resource-api-endpoint</artifactId>
+      <artifactId>fence-common</artifactId>
+      <version>${project.version}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.servicecomb</groupId>
@@ -81,4 +57,4 @@
       </plugin>
     </plugins>
   </build>
-</project>
\ No newline at end of file
+</project>
diff --git a/api/resource-server/endpoint/src/main/java/org/apache/servicecomb/fence/resource/AccessDeniedExceptionExceptionToProducerResponseConverter.java b/resource-server/src/main/java/org/apache/servicecomb/fence/resource/AccessDeniedExceptionExceptionToProducerResponseConverter.java
similarity index 100%
rename from api/resource-server/endpoint/src/main/java/org/apache/servicecomb/fence/resource/AccessDeniedExceptionExceptionToProducerResponseConverter.java
rename to resource-server/src/main/java/org/apache/servicecomb/fence/resource/AccessDeniedExceptionExceptionToProducerResponseConverter.java
diff --git a/api/resource-server/endpoint/src/main/java/org/apache/servicecomb/fence/resource/AccessDynamicProperties.java b/resource-server/src/main/java/org/apache/servicecomb/fence/resource/AccessDynamicProperties.java
similarity index 100%
rename from api/resource-server/endpoint/src/main/java/org/apache/servicecomb/fence/resource/AccessDynamicProperties.java
rename to resource-server/src/main/java/org/apache/servicecomb/fence/resource/AccessDynamicProperties.java
diff --git a/api/resource-server/endpoint/src/main/java/org/apache/servicecomb/fence/resource/AccessDynamicPropertiesManager.java b/resource-server/src/main/java/org/apache/servicecomb/fence/resource/AccessDynamicPropertiesManager.java
similarity index 100%
rename from api/resource-server/endpoint/src/main/java/org/apache/servicecomb/fence/resource/AccessDynamicPropertiesManager.java
rename to resource-server/src/main/java/org/apache/servicecomb/fence/resource/AccessDynamicPropertiesManager.java
diff --git a/api/resource-server/endpoint/src/main/java/org/apache/servicecomb/fence/resource/AuthFilter.java b/resource-server/src/main/java/org/apache/servicecomb/fence/resource/AuthFilter.java
similarity index 100%
rename from api/resource-server/endpoint/src/main/java/org/apache/servicecomb/fence/resource/AuthFilter.java
rename to resource-server/src/main/java/org/apache/servicecomb/fence/resource/AuthFilter.java
diff --git a/api/resource-server/endpoint/src/main/java/org/apache/servicecomb/fence/resource/AuthFiltersBean.java b/resource-server/src/main/java/org/apache/servicecomb/fence/resource/AuthFiltersBean.java
similarity index 100%
rename from api/resource-server/endpoint/src/main/java/org/apache/servicecomb/fence/resource/AuthFiltersBean.java
rename to resource-server/src/main/java/org/apache/servicecomb/fence/resource/AuthFiltersBean.java
diff --git a/api/resource-server/endpoint/src/main/java/org/apache/servicecomb/fence/resource/AuthenticationAuthFilter.java b/resource-server/src/main/java/org/apache/servicecomb/fence/resource/AuthenticationAuthFilter.java
similarity index 100%
rename from api/resource-server/endpoint/src/main/java/org/apache/servicecomb/fence/resource/AuthenticationAuthFilter.java
rename to resource-server/src/main/java/org/apache/servicecomb/fence/resource/AuthenticationAuthFilter.java
diff --git a/api/resource-server/endpoint/src/main/java/org/apache/servicecomb/fence/resource/ConfigBasedAuthoriaztionAuthFilter.java b/resource-server/src/main/java/org/apache/servicecomb/fence/resource/ConfigBasedAuthoriaztionAuthFilter.java
similarity index 100%
rename from api/resource-server/endpoint/src/main/java/org/apache/servicecomb/fence/resource/ConfigBasedAuthoriaztionAuthFilter.java
rename to resource-server/src/main/java/org/apache/servicecomb/fence/resource/ConfigBasedAuthoriaztionAuthFilter.java
diff --git a/api/resource-server/endpoint/src/main/java/org/apache/servicecomb/fence/resource/ResourceAuthHandler.java b/resource-server/src/main/java/org/apache/servicecomb/fence/resource/ResourceAuthHandler.java
similarity index 100%
rename from api/resource-server/endpoint/src/main/java/org/apache/servicecomb/fence/resource/ResourceAuthHandler.java
rename to resource-server/src/main/java/org/apache/servicecomb/fence/resource/ResourceAuthHandler.java
diff --git a/api/resource-server/endpoint/src/main/java/org/apache/servicecomb/fence/resource/SimpleAuthentication.java b/resource-server/src/main/java/org/apache/servicecomb/fence/resource/SimpleAuthentication.java
similarity index 100%
rename from api/resource-server/endpoint/src/main/java/org/apache/servicecomb/fence/resource/SimpleAuthentication.java
rename to resource-server/src/main/java/org/apache/servicecomb/fence/resource/SimpleAuthentication.java
diff --git a/resource-server/src/main/java/org/apache/servicecomb/fence/resource/FileEndpoint.java b/resource-server/src/main/java/org/apache/servicecomb/fence/resource/example/FileEndpoint.java
similarity index 96%
rename from resource-server/src/main/java/org/apache/servicecomb/fence/resource/FileEndpoint.java
rename to resource-server/src/main/java/org/apache/servicecomb/fence/resource/example/FileEndpoint.java
index 04c1db3..46b5123 100644
--- a/resource-server/src/main/java/org/apache/servicecomb/fence/resource/FileEndpoint.java
+++ b/resource-server/src/main/java/org/apache/servicecomb/fence/resource/example/FileEndpoint.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.fence.resource;
+package org.apache.servicecomb.fence.resource.example;
 
 import org.apache.servicecomb.provider.rest.common.RestSchema;
 import org.springframework.beans.factory.annotation.Autowired;
diff --git a/resource-server/src/main/java/org/apache/servicecomb/fence/resource/FileStoreService.java b/resource-server/src/main/java/org/apache/servicecomb/fence/resource/example/FileStoreService.java
similarity index 94%
rename from resource-server/src/main/java/org/apache/servicecomb/fence/resource/FileStoreService.java
rename to resource-server/src/main/java/org/apache/servicecomb/fence/resource/example/FileStoreService.java
index 5321201..940d08e 100644
--- a/resource-server/src/main/java/org/apache/servicecomb/fence/resource/FileStoreService.java
+++ b/resource-server/src/main/java/org/apache/servicecomb/fence/resource/example/FileStoreService.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.fence.resource;
+package org.apache.servicecomb.fence.resource.example;
 
 import org.springframework.web.multipart.MultipartFile;
 
diff --git a/resource-server/src/main/java/org/apache/servicecomb/fence/resource/HandlerAuthEndpoint.java b/resource-server/src/main/java/org/apache/servicecomb/fence/resource/example/HandlerAuthEndpoint.java
similarity index 96%
rename from resource-server/src/main/java/org/apache/servicecomb/fence/resource/HandlerAuthEndpoint.java
rename to resource-server/src/main/java/org/apache/servicecomb/fence/resource/example/HandlerAuthEndpoint.java
index f922025..338ff88 100644
--- a/resource-server/src/main/java/org/apache/servicecomb/fence/resource/HandlerAuthEndpoint.java
+++ b/resource-server/src/main/java/org/apache/servicecomb/fence/resource/example/HandlerAuthEndpoint.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.fence.resource;
+package org.apache.servicecomb.fence.resource.example;
 
 import org.apache.servicecomb.provider.rest.common.RestSchema;
 import org.springframework.web.bind.annotation.PostMapping;
diff --git a/resource-server/src/main/java/org/apache/servicecomb/fence/resource/LocalFileStoreService.java b/resource-server/src/main/java/org/apache/servicecomb/fence/resource/example/LocalFileStoreService.java
similarity index 97%
rename from resource-server/src/main/java/org/apache/servicecomb/fence/resource/LocalFileStoreService.java
rename to resource-server/src/main/java/org/apache/servicecomb/fence/resource/example/LocalFileStoreService.java
index 729c88b..9e4bd38 100644
--- a/resource-server/src/main/java/org/apache/servicecomb/fence/resource/LocalFileStoreService.java
+++ b/resource-server/src/main/java/org/apache/servicecomb/fence/resource/example/LocalFileStoreService.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.fence.resource;
+package org.apache.servicecomb.fence.resource.example;
 
 import java.io.File;
 import java.io.FileOutputStream;
diff --git a/resource-server/src/main/java/org/apache/servicecomb/fence/resource/PreMethodAuthEndpoint.java b/resource-server/src/main/java/org/apache/servicecomb/fence/resource/example/PreMethodAuthEndpoint.java
similarity index 96%
rename from resource-server/src/main/java/org/apache/servicecomb/fence/resource/PreMethodAuthEndpoint.java
rename to resource-server/src/main/java/org/apache/servicecomb/fence/resource/example/PreMethodAuthEndpoint.java
index 9243d53..d0c50b8 100644
--- a/resource-server/src/main/java/org/apache/servicecomb/fence/resource/PreMethodAuthEndpoint.java
+++ b/resource-server/src/main/java/org/apache/servicecomb/fence/resource/example/PreMethodAuthEndpoint.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.fence.resource;
+package org.apache.servicecomb.fence.resource.example;
 
 import org.apache.servicecomb.provider.rest.common.RestSchema;
 import org.springframework.security.access.prepost.PreAuthorize;
diff --git a/api/resource-server/endpoint/src/main/resources/META-INF/services/org.apache.servicecomb.swagger.invocation.exception.ExceptionToProducerResponseConverter b/resource-server/src/main/resources/META-INF/services/org.apache.servicecomb.swagger.invocation.exception.ExceptionToProducerResponseConverter
similarity index 100%
rename from api/resource-server/endpoint/src/main/resources/META-INF/services/org.apache.servicecomb.swagger.invocation.exception.ExceptionToProducerResponseConverter
rename to resource-server/src/main/resources/META-INF/services/org.apache.servicecomb.swagger.invocation.exception.ExceptionToProducerResponseConverter
diff --git a/api/resource-server/endpoint/src/main/resources/config/cse.handler.xml b/resource-server/src/main/resources/config/cse.handler.xml
similarity index 100%
rename from api/resource-server/endpoint/src/main/resources/config/cse.handler.xml
rename to resource-server/src/main/resources/config/cse.handler.xml