Project

General

Profile

« Previous | Next » 

Revision 53003

1. Add env var for cookies 2. Add sushi controllers 3. Bug fix on piwik/repo 4. Add stats controllers/service

View differences:

FrontEndLinkURIAuthenticationSuccessHandler.java
3 3
import com.google.gson.JsonObject;
4 4
import org.apache.log4j.Logger;
5 5
import org.mitre.openid.connect.model.OIDCAuthenticationToken;
6
import org.springframework.beans.factory.annotation.Value;
6 7
import org.springframework.security.core.Authentication;
7 8
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
8 9

  
......
25 26
        LOGGER.debug("Front end uri : " + frontEndURI);
26 27
    }
27 28

  
29

  
30
    @Value("${aai.mode}")
31
    private String aai_mode;
32

  
28 33
    @Override
29 34
    public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {
30 35

  
......
59 64
        Cookie openAIREUser = new Cookie("openAIREUser", new Gson().toJson(userInfo) );
60 65
        openAIREUser.setMaxAge(14400);
61 66
        openAIREUser.setPath("/");
62
//        openAIREUser .setDomain(".openaire.eu");
67
        if(aai_mode.equalsIgnoreCase("production") || aai_mode.equalsIgnoreCase("beta"))
68
            openAIREUser .setDomain(".openaire.eu");
63 69
//        openAIREUser.setDomain(".athenarc.gr");
64 70
        response.addCookie(openAIREUser);
65 71

  
66 72

  
67 73
        Cookie accessToken = new Cookie("AccessToken", authOIDC.getAccessTokenValue());
68 74
        accessToken.setMaxAge(14400);
69
//        accessToken.setDomain(".openaire.eu");
75
        if(aai_mode.equalsIgnoreCase("production") || aai_mode.equalsIgnoreCase("beta"))
76
            accessToken.setDomain(".openaire.eu");
70 77
        accessToken.setPath("/");
71 78

  
72 79
//        accessToken.setDomain(".athenarc.gr");

Also available in: Unified diff