class VKProvider extends BaseVKProvider with CommonSocialProfileBuilder
The VK OAuth2 Provider.
- Alphabetic
- By Inheritance
- VKProvider
- CommonSocialProfileBuilder
- BaseVKProvider
- OAuth2Provider
- Logger
- OAuth2Constants
- SocialStateProvider
- SocialProvider
- ExecutionContextProvider
- SocialProfileBuilder
- Provider
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
VKProvider(httpLayer: HTTPLayer, stateHandler: SocialStateHandler, settings: OAuth2Settings)
- httpLayer
The HTTP layer implementation.
- stateHandler
The state provider implementation.
- settings
The provider settings.
Type Members
-
type
A = OAuth2Info
The type of the auth info.
The type of the auth info.
- Definition Classes
- OAuth2Provider → SocialProvider
-
type
Content = JsValue
The content type to parse a profile from.
The content type to parse a profile from.
- Definition Classes
- BaseVKProvider → SocialProfileBuilder
-
type
Profile = CommonSocialProfile
The type of the profile a profile builder is responsible for.
The type of the profile a profile builder is responsible for.
- Definition Classes
- CommonSocialProfileBuilder
-
type
Self = VKProvider
The type of this class.
The type of this class.
- Definition Classes
- VKProvider → SocialProvider
-
type
Settings = OAuth2Settings
The settings type.
The settings type.
- Definition Classes
- OAuth2Provider → SocialProvider
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
val
AccessDenied: String
- Definition Classes
- OAuth2Constants
-
val
AccessToken: String
- Definition Classes
- OAuth2Constants
-
val
AuthorizationCode: String
- Definition Classes
- OAuth2Constants
-
val
ClientID: String
- Definition Classes
- OAuth2Constants
-
val
ClientSecret: String
- Definition Classes
- OAuth2Constants
-
val
Code: String
- Definition Classes
- OAuth2Constants
-
val
Error: String
- Definition Classes
- OAuth2Constants
-
val
Expires: String
- Definition Classes
- OAuth2Constants
-
val
ExpiresIn: String
- Definition Classes
- OAuth2Constants
-
val
GrantType: String
- Definition Classes
- OAuth2Constants
-
val
RedirectURI: String
- Definition Classes
- OAuth2Constants
-
val
RefreshToken: String
- Definition Classes
- OAuth2Constants
-
val
ResponseType: String
- Definition Classes
- OAuth2Constants
-
val
Scope: String
- Definition Classes
- OAuth2Constants
-
val
State: String
- Definition Classes
- OAuth2Constants
-
val
TokenType: String
- Definition Classes
- OAuth2Constants
-
val
accessTokeResponseCode: Int
The default access token response code.
The default access token response code.
Override this if a specific provider uses another HTTP status code for a successful access token response.
- Attributes
- protected
- Definition Classes
- OAuth2Provider
-
implicit
val
accessTokenReads: Reads[OAuth2Info]
The implicit access token reads.
The implicit access token reads.
VK provider needs it own Json reads to extract the email from response.
- Attributes
- protected
- Definition Classes
- BaseVKProvider → OAuth2Provider
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
authenticate[S <: SocialStateItem, B](userState: S)(implicit format: Format[S], request: ExtractableRequest[B], classTag: ClassTag[S]): Future[Either[Result, StatefulAuthInfo[A, S]]]
Authenticates the user and returns the auth information and the user state.
Authenticates the user and returns the auth information and the user state.
Returns either a StatefulAuthInfo if all went OK or a
play.api.mvc.Resultthat the controller sends to the browser (e.g.: in the case of OAuth where the user needs to be redirected to the service provider).- S
The type of the user state.
- B
The type of the request body.
- format
The JSON format to the transform the user state into JSON.
- request
The request.
- classTag
The class tag for the user state item.
- returns
Either a
play.api.mvc.Resultor the StatefulAuthInfo from the provider.
- Definition Classes
- OAuth2Provider → SocialStateProvider
-
def
authenticate[B]()(implicit request: ExtractableRequest[B]): Future[Either[Result, OAuth2Info]]
Starts the authentication process.
Starts the authentication process.
- B
The type of the request body.
- request
The current request.
- returns
Either a Result or the auth info from the provider.
- Definition Classes
- OAuth2Provider → SocialProvider
-
def
buildInfo(response: WSResponse): Try[OAuth2Info]
Builds the OAuth2 info from response.
Builds the OAuth2 info from response.
- response
The response from the provider.
- returns
The OAuth2 info on success, otherwise a failure.
- Attributes
- protected
- Definition Classes
- OAuth2Provider
-
def
buildProfile(authInfo: OAuth2Info): Future[Profile]
Builds the social profile.
Builds the social profile.
- authInfo
The auth info received from the provider.
- returns
On success the build social profile, otherwise a failure.
- Attributes
- protected
- Definition Classes
- BaseVKProvider → SocialProfileBuilder
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
implicit
val
executionContext: ExecutionContext
The execution context to handle the asynchronous operations.
The execution context to handle the asynchronous operations.
- Definition Classes
- SocialProvider → ExecutionContextProvider
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
getAccessToken(code: String)(implicit request: RequestHeader): Future[OAuth2Info]
Gets the access token.
Gets the access token.
- code
The access code.
- request
The current request.
- returns
The info containing the access token.
- Attributes
- protected
- Definition Classes
- OAuth2Provider
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
handleAuthorizationFlow[B](stateHandler: SocialStateHandler)(implicit request: ExtractableRequest[B]): Future[Result]
Handles the authorization step of the OAuth2 flow.
Handles the authorization step of the OAuth2 flow.
- B
The type of the request body.
- stateHandler
The state handler to use.
- request
The request.
- returns
The redirect to the authorization URL of the OAuth2 provider.
- Attributes
- protected
- Definition Classes
- OAuth2Provider
-
def
handleFlow[L, R, B](left: ⇒ Future[L])(right: (String) ⇒ Future[R])(implicit request: ExtractableRequest[B]): Future[Either[L, R]]
Handles the OAuth2 flow.
Handles the OAuth2 flow.
The left flow is the authorization flow, which will be processed, if no
codeparameter exists in the request. The right flow is the access token flow, which will be executed after a successful authorization.- L
The return type of the left flow.
- R
The return type of the right flow.
- B
The type of the request body.
- left
The authorization flow.
- right
The access token flow.
- request
The request.
- returns
Either the left or the right flow.
- Definition Classes
- OAuth2Provider
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
val
headers: Seq[(String, String)]
A list with headers to send to the API.
A list with headers to send to the API.
- Attributes
- protected
- Definition Classes
- OAuth2Provider
-
val
httpLayer: HTTPLayer
The HTTP layer implementation.
The HTTP layer implementation.
- Attributes
- protected
- Definition Classes
- VKProvider → SocialProvider
-
val
id: String
The provider ID.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
val
logger: Logger
A named logger instance.
A named logger instance.
- Definition Classes
- Logger
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
val
profileParser: VKProfileParser
The profile parser implementation.
The profile parser implementation.
- returns
The profile parser implementation.
- Definition Classes
- VKProvider → SocialProfileBuilder
-
def
resolveCallbackURL(url: String)(implicit request: RequestHeader): String
Resolves the url to be absolute relative to the request.
Resolves the url to be absolute relative to the request.
This will pass the url through if its already absolute.
- url
The url to resolve.
- request
The current request.
- returns
The absolute url.
- Attributes
- protected
- Definition Classes
- SocialProvider
-
def
retrieveProfile(authInfo: A): Future[Profile]
Retrieves the user profile for the given auth info.
Retrieves the user profile for the given auth info.
This method can be used to retrieve the profile information for an already authenticated identity.
- authInfo
The auth info for which the profile information should be retrieved.
- returns
The profile information for the given auth info.
- Definition Classes
- SocialProvider
-
val
settings: OAuth2Settings
Gets the provider settings.
Gets the provider settings.
- returns
The provider settings.
- Definition Classes
- VKProvider → SocialProvider
-
val
stateHandler: SocialStateHandler
The social state handler implementation.
The social state handler implementation.
- Attributes
- protected
- Definition Classes
- VKProvider → OAuth2Provider
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
val
urls: Map[String, String]
Defines the URLs that are needed to retrieve the profile data.
Defines the URLs that are needed to retrieve the profile data.
- returns
The URLs that are needed to retrieve the profile data.
- Attributes
- protected
- Definition Classes
- BaseVKProvider → SocialProfileBuilder
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
withSettings(f: (Settings) ⇒ Settings): VKProvider
Gets a provider initialized with a new settings object.
Gets a provider initialized with a new settings object.
- f
A function which gets the settings passed and returns different settings.
- returns
An instance of the provider initialized with new settings.
- Definition Classes
- VKProvider → SocialProvider