Back to project page utexas-utilities.
The source code is released under:
Apache License
If you think the Android project utexas-utilities listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.nasageek.utexasutilities; //from w w w . ja v a 2s . c o m import android.content.Context; import java.net.CookieHandler; import java.net.CookieManager; import java.net.CookieStore; import java.net.HttpCookie; import java.net.URI; import static com.nasageek.utexasutilities.UTilitiesApplication.UTD_AUTH_COOKIE_KEY; /** * Created by chris on 9/16/14. */ public class UtdAuthCookie extends AuthCookie { public UtdAuthCookie(Context con) { super(UTD_AUTH_COOKIE_KEY, "utlogin-prod", "https://login.utexas.edu/openam/UI/Login", "IDToken1", "IDToken2", con); } public void setAuthCookieVal(String authCookie) { this.authCookie = authCookie; settings.edit().putString(prefKey, authCookie).apply(); /* this is technically unnecessary if OkHttp handled the authentication, because it will have already set the cookies in the CookieHandler. It doesn't seem to cause any issues just to re-add the cookies, though */ HttpCookie httpCookie = new HttpCookie(authCookieKey, authCookie); // hardcode utdirect URL for now until I figure out LARES posting stuff httpCookie.setDomain("utdirect.utexas.edu"); try { CookieStore cookies = ((CookieManager) CookieHandler.getDefault()).getCookieStore(); cookies.add(URI.create("utdirect.utexas.edu"), httpCookie); } catch (IllegalArgumentException e) { e.printStackTrace(); } cookieHasBeenSet = true; } }