@Component public class Auth0CallbackHandler extends Object
package com.auth0.example;
import com.auth0.web.Auth0CallbackHandler;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@Controller
public class CallbackController extends Auth0CallbackHandler {
@RequestMapping(value = "${auth0.loginCallback}", method = RequestMethod.GET)
protected void callback(final HttpServletRequest req, final HttpServletResponse res) throws ServletException, IOException {
super.handle(req, res);
}
}
| Modifier and Type | Field and Description |
|---|---|
protected com.auth0.Auth0Client |
auth0Client |
protected Auth0Config |
auth0Config |
protected String |
redirectOnFail |
protected String |
redirectOnSuccess |
| Constructor and Description |
|---|
Auth0CallbackHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected com.auth0.Tokens |
fetchTokens(javax.servlet.http.HttpServletRequest req)
Get tokens for this request
|
void |
handle(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Entrypoint for http request
1).
|
protected boolean |
hasError(javax.servlet.http.HttpServletRequest req)
Checks for the presence of an error in the http servlet request params
|
protected boolean |
isValidRequest(javax.servlet.http.HttpServletRequest req)
Indicates whether the request is deemed valid
|
protected boolean |
isValidState(javax.servlet.http.HttpServletRequest req)
Indicates whether the nonce value in storage matches the nonce value passed
with the http servlet request
|
protected void |
onFailure(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
Exception e)
Actions / navigation to take when a request is deemed unsuccessful by this callback handler
|
protected void |
onSuccess(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Actions / navigation to take when a request is deemed successful by this callback handler
|
protected void |
setAuth0Client(com.auth0.Auth0Client auth0Client) |
protected void |
setAuth0Config(Auth0Config auth0Config) |
protected void |
store(com.auth0.Tokens tokens,
com.auth0.Auth0User user,
javax.servlet.http.HttpServletRequest req)
Store tokens and auth0User
|
protected String redirectOnSuccess
protected String redirectOnFail
protected Auth0Config auth0Config
protected com.auth0.Auth0Client auth0Client
@Autowired protected void setAuth0Client(com.auth0.Auth0Client auth0Client)
@Autowired protected void setAuth0Config(Auth0Config auth0Config)
public void handle(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws IOException,
javax.servlet.ServletException
IOExceptionjavax.servlet.ServletExceptionprotected void onSuccess(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws javax.servlet.ServletException,
IOException
javax.servlet.ServletExceptionIOExceptionprotected void onFailure(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
Exception e)
throws javax.servlet.ServletException,
IOException
javax.servlet.ServletExceptionIOExceptionprotected void store(com.auth0.Tokens tokens,
com.auth0.Auth0User user,
javax.servlet.http.HttpServletRequest req)
tokens - the tokensuser - the user profilereq - the http servlet requestprotected com.auth0.Tokens fetchTokens(javax.servlet.http.HttpServletRequest req)
req - the http servlet requestprotected boolean isValidRequest(javax.servlet.http.HttpServletRequest req)
throws IOException
req - the http servlet requestIOExceptionprotected boolean hasError(javax.servlet.http.HttpServletRequest req)
req - the http servlet requestprotected boolean isValidState(javax.servlet.http.HttpServletRequest req)
req - the http servlet requestCopyright © 2016. All Rights Reserved.