diff --git a/owncloud-android-library b/owncloud-android-library
index 3b9777c5b6..c8f6e5ad57 160000
--- a/owncloud-android-library
+++ b/owncloud-android-library
@@ -1 +1 @@
-Subproject commit 3b9777c5b67b63792ffb86e9da6c12d3264b4f59
+Subproject commit c8f6e5ad57ee27fdac39c7b14eb6ab1942a92d49
diff --git a/res/values/strings.xml b/res/values/strings.xml
index d7c45b87ae..dd8ce04fc0 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -341,6 +341,7 @@
with you
%1$s shared \"%2$s\" with you
+ \"%1$s\" has been shared with you
Refresh connection
Server address
diff --git a/src/com/owncloud/android/operations/CreateShareOperation.java b/src/com/owncloud/android/operations/CreateShareOperation.java
index 7cdcc083cf..a7270eb8b8 100644
--- a/src/com/owncloud/android/operations/CreateShareOperation.java
+++ b/src/com/owncloud/android/operations/CreateShareOperation.java
@@ -161,9 +161,16 @@ public class CreateShareOperation extends SyncOperation {
OCFile file = getStorageManager().getFileByPath(mPath);
if (file!=null) {
mSendIntent.putExtra(Intent.EXTRA_TEXT, share.getShareLink());
- mSendIntent.putExtra(Intent.EXTRA_SUBJECT,
- String.format(mContext.getString(R.string.subject_token),
- getClient().getCredentials().getUsername(), file.getFileName()));
+ if (getClient().getCredentials().getUsername() == null) {
+ //in saml is null
+ mSendIntent.putExtra(Intent.EXTRA_SUBJECT,
+ String.format(mContext.getString(R.string.saml_subject_token),
+ file.getFileName()));
+ } else {
+ mSendIntent.putExtra(Intent.EXTRA_SUBJECT,
+ String.format(mContext.getString(R.string.subject_token),
+ getClient().getCredentials().getUsername(), file.getFileName()));
+ }
file.setPublicLink(share.getShareLink());
file.setShareByLink(true);
getStorageManager().saveFile(file);
diff --git a/src/com/owncloud/android/services/OperationsService.java b/src/com/owncloud/android/services/OperationsService.java
index 7667e90ad2..2514c4de67 100644
--- a/src/com/owncloud/android/services/OperationsService.java
+++ b/src/com/owncloud/android/services/OperationsService.java
@@ -457,7 +457,8 @@ public class OperationsService extends Service {
// TODO refactor to run GetUserName as AsyncTask in the context of
// AuthenticatorActivity
credentials = OwnCloudCredentialsFactory.newSamlSsoCredentials(
- mLastTarget.mCookie); // SAML SSO
+ null, // unknown
+ mLastTarget.mCookie); // SAML SSO
}
OwnCloudAccount ocAccount = new OwnCloudAccount(
mLastTarget.mServerUrl, credentials);