net.gplatform:spring-social-qq

parent project for all gplatform project

License

License

Categories

Categories

Net ORM Data
GroupId

GroupId

net.gplatform
ArtifactId

ArtifactId

spring-social-qq
Last Version

Last Version

1.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

parent project for all gplatform project
Project Organization

Project Organization

Shark Xu
Source Code Management

Source Code Management

https://github.com/zwzwzw/spring-social-qq

Download spring-social-qq

How to add to project

<!-- https://jarcasting.com/artifacts/net.gplatform/spring-social-qq/ -->
<dependency>
    <groupId>net.gplatform</groupId>
    <artifactId>spring-social-qq</artifactId>
    <version>1.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/net.gplatform/spring-social-qq/
implementation 'net.gplatform:spring-social-qq:1.0.2'
// https://jarcasting.com/artifacts/net.gplatform/spring-social-qq/
implementation ("net.gplatform:spring-social-qq:1.0.2")
'net.gplatform:spring-social-qq:jar:1.0.2'
<dependency org="net.gplatform" name="spring-social-qq" rev="1.0.2">
  <artifact name="spring-social-qq" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.gplatform', module='spring-social-qq', version='1.0.2')
)
libraryDependencies += "net.gplatform" % "spring-social-qq" % "1.0.2"
[net.gplatform/spring-social-qq "1.0.2"]

Dependencies

compile (2)

Group / Artifact Type Version
net.gplatform : spring-social-base jar 1.0.3
net.gplatform : Sdk4J jar 2.0

Project Modules

There are no modules declared in this project.

##Config:

The config can be done by spring boot autoconfig.

U only need to impl & register SignInAdapter to context to perform signin after oauth check

##Usage:

  1. Add maven depency into your project

     <dependency>
     	<groupId>net.gplatform</groupId>
     	<artifactId>spring-social-qq</artifactId>
     	<version>1.0.2</version>
     </dependency>
    
  2. Config appId & appSecret

    • Copy qqconnectconfig.properties to your project classpath & change app_ID & app_KEY to the value you retrieved from Tencent Note: This is used by QQ SDK.

    • Also add above value under key spring.social.qq.appId & spring.social.qq.appSecret in application.properties Note: This is used by spring boot

  3. Implement SignInAdapter Code Example:

     @Component
     public class MySignInAdapter implements SignInAdapter {
     	@Override
     	public String signIn(String localUserId, Connection<?> connection, NativeWebRequest request) {
     		LoginUtil.signin(localUserId, null);
     		
     		String goToURL = "/home"
     		return goToURL;
     	}
     }
    
  4. Add QQ login button in your page

    Code Example:

     <form method="POST" action="/yourAppName/signin/qq">
     	<input type="hidden" name="scope" value="get_user_info,add_topic,add_one_blog,add_album,upload_pic,list_album,add_share,check_page_fans,add_t,add_pic_t,del_t,get_repost_list,get_info,get_other_info,get_fanslist,get_idollist,add_idol,del_ido,get_tenpay_addr">
     	<div class="row" style="margin-left: 10px;">
     		<button type="submit">
     			Login With QQ
     		</button>
     	</div>
     </form>
    

    Note: You need to replace yourAppName with correct value. For supported scope value, please refer to Open QQ specification in http://open.qq.com/

Versions

Version
1.0.2
1.0.1
1.0.0