Following the tutorial I am able to authenticate, create mutable data, etc., but when I try to create unregistered session in order to access the newly created data as anonymous user I am having trouble getting it to work.
I am using code like this:
@OnClick(R.id.btn_connect)
void onClickBtnConnect() {
try {
Client.load(this);
CompletableFuture<Request> connReq = Session.getUnregisteredSessionRequest("com.bolyartech.safenettest");
final String AUTH_URL_PREFIX = "safe-auth://";
String url = AUTH_URL_PREFIX + "com.bolyartech.safenettest" + '/' + connReq.get().getUri();
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(intent);
} catch (ExecutionException | InterruptedException e) {
e.printStackTrace();
}
}
Authenticator is started, shows the “Auth” dialog but with empty fields for app id, etc. When “Allow” button is pressed exception is thrown:
android.runtime.JavaProxyThrowable: System.UriFormatException: Invalid URI: The URI is empty.
Seems like my request to the Authenticator is not properly formated.
How to create unregistered session? Are there examples (programming language does not matter) where I can see how it is supposed to be done?