-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDKS-2782 cookiename/AM URL/Realm are mandatory field #361
Conversation
e06a326
to
89bd2cc
Compare
89bd2cc
to
5eb711d
Compare
url = sharedPreferences.getString(ConfigHelper.url, null) ?: "" | ||
realm = sharedPreferences.getString(ConfigHelper.realm, null) ?: "" | ||
cookieName = sharedPreferences.getString(ConfigHelper.cookieName, null) ?: "" | ||
url = sharedPreferences.getString(ConfigHelper.url, null) ?: context.getString(R.string.forgerock_url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use the defValue sharedPreferences.getString(value, defValue) for the null case.
sharePreferences.getString(ConfigHelper.url, context.getString(R.string.forgerock_url)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no change required. already discussed
forgerock-auth/src/test/java/org/forgerock/android/auth/ConfigHelperTest.kt
Show resolved
Hide resolved
@@ -47,6 +47,8 @@ public static synchronized void start(Context context, @Nullable FROptions optio | |||
if(!started || !FROptions.equals(cachedOptions, options)) { | |||
started = true; | |||
FROptions currentOptions = ConfigHelper.load(context, options); | |||
//Validate (AM URL, Realm, CookieName) is not Empty. If its empty will throw IllegalArgumentException. | |||
currentOptions.validateConfig(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we throwing the new exception here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes , we are throwing a new exception, its intentional when the user supplies empty url, realm, cookiename . we dont usually declare the Runtime exception
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, put a note in CHANGELOG.md about this change.
Other than that the changes look good to me!
172aee8
5eb711d
to
172aee8
Compare
…les for url,realm,cookiename
172aee8
to
2460b0a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes looks good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍🏻
JIRA Ticket
Please link jira ticket here
Description
1.The idea is to keep by default the cookiename and realm has value if the user didnt add this
cookiename = iplanetdirectorypro
realm = root