Configure the custom social connection
on the dashboard by adding all the data needed by the extension.
- Name
- Authorization URL
- Token URL
- Client ID
- Client Secret
/* | |
* PermissionHandlerActivity.java | |
* | |
* Copyright (c) 2016 Auth0 (http://auth0.com) | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
public class CustomField implements Parcelable { | |
private static final int CAP_SENTENCES = 0; | |
private static final int CAP_WORDS = 1; | |
private static final int CAP_CHARACTERS = 2; | |
private static final int MAX_ALLOWED_LENGTH = 100; | |
private int cap; | |
private int maxLength; | |
private boolean onlyNumbers; | |
private boolean hideInput; |
At first, I wanted AuthenticationError to be a class not extending any Exception class. It received the Map<Object, String> and the Throwable to keep the error stack.
Then I've found that many calls from our *Request
classes instantiated a new Auth0Exception giving a simple message like "cannot parse this JSON" or "invalid response" instead of the values map, so I needed to add that String as another parameter. Maybe in a second constructor.
It seems better to extend Auth0Exception
so the default getMessage()
and getCause()
were there already. I thought about creating an interface AuthenticationError
with the common error methods, like getError()
, getDescription()
and the rest of the values inside a map getValues()
. So I ended up with a class that extends Auth0Exception and implements AuthenticationError. ---> AuthenticationException
.
I tried making the callback.onFailure
return an AuthenticationError
(interface) ob
package com.lbalmaceda.genericsproject; | |
import com.lbalmaceda.genericsproject.exceptions.CustomException; | |
/** | |
* Created by lbalmaceda on 6/21/16. | |
*/ | |
public interface CustomCallback<T, U extends CustomException> { | |
void onSuccess(T response); |
package com.lbalmaceda.genericsproject; | |
import com.lbalmaceda.genericsproject.exceptions.BaseException; | |
/** | |
* Created by lbalmaceda on 6/21/16. | |
*/ | |
public interface CustomCallback<T, U extends BaseException> { | |
void onSuccess(T response); |
package com.lbalmaceda.genericsproject; | |
import com.lbalmaceda.genericsproject.exceptions.BaseException; | |
/** | |
* Created by lbalmaceda on 6/21/16. | |
*/ | |
public interface CustomCallback<T, U extends BaseException> { | |
void onSuccess(T response); |
//This is the abstract AuthProvider, with permission handling. | |
public abstract class AuthProvider implements PermissionProvider { | |
public AuthProvider(@NonNull PermissionHandler handler) { | |
this.handler = handler; | |
} | |
public void start(@NonNull Activity activity, @NonNull AuthCallback callback, int permissionRequestCode) { | |
this.callback = callback; |