Skip to content

Commit a0458c0

Browse files
rename par method to authorizeWithPAR for clarity and consistency
1 parent e2985ad commit a0458c0

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

EXAMPLES.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ The PAR flow requires coordination between your backend (BFF) and the mobile app
314314
val requestUri = yourBffClient.initiatePAR(scope, audience)
315315

316316
// Step 2 & 3: SDK opens browser and returns authorization code
317-
WebAuthProvider.par(account)
317+
WebAuthProvider.authorizeWithPAR(account)
318318
.start(context, requestUri, object : Callback<AuthorizationCode, AuthenticationException> {
319319
override fun onSuccess(result: AuthorizationCode) {
320320
// Step 4: Send code to BFF to exchange for tokens
@@ -340,7 +340,7 @@ try {
340340
val requestUri = yourBffClient.initiatePAR(scope, audience)
341341

342342
// Step 2 & 3: SDK opens browser and returns authorization code
343-
val authCode = WebAuthProvider.par(account)
343+
val authCode = WebAuthProvider.authorizeWithPAR(account)
344344
.await(context, requestUri)
345345

346346
// Step 4: Send code to BFF to exchange for tokens

auth0/src/main/java/com/auth0/android/provider/WebAuthProvider.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public object WebAuthProvider : SenderConstraining<WebAuthProvider> {
8989
* @return a new PARBuilder instance to customize.
9090
*/
9191
@JvmStatic
92-
public fun par(account: Auth0): PARBuilder {
92+
public fun authorizeWithPAR(account: Auth0): PARBuilder {
9393
return PARBuilder(account)
9494
}
9595

@@ -671,7 +671,7 @@ public object WebAuthProvider : SenderConstraining<WebAuthProvider> {
671671
*
672672
* Example usage:
673673
* ```kotlin
674-
* WebAuthProvider.par(account)
674+
* WebAuthProvider.authorizeWithPAR(account)
675675
* .start(context, requestURI, callback)
676676
* ```
677677
*/

auth0/src/test/java/com/auth0/android/provider/PARCodeManagerTest.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import android.net.Uri
66
import com.auth0.android.Auth0
77
import com.auth0.android.authentication.AuthenticationException
88
import com.auth0.android.callback.Callback
9-
import com.auth0.android.provider.WebAuthProvider.par
9+
import com.auth0.android.provider.WebAuthProvider.authorizeWithPAR
1010
import com.auth0.android.provider.WebAuthProvider.resume
1111
import com.auth0.android.request.internal.ThreadSwitcherShadow
1212
import com.auth0.android.result.AuthorizationCode
@@ -69,7 +69,7 @@ public class PARCodeManagerTest {
6969

7070
@Test
7171
public fun shouldStartPARFlowWithCorrectAuthorizeUri() {
72-
par(account)
72+
authorizeWithPAR(account)
7373
.start(activity, REQUEST_URI, callback)
7474

7575
Assert.assertNotNull(WebAuthProvider.managerInstance)
@@ -87,7 +87,7 @@ public class PARCodeManagerTest {
8787

8888
@Test
8989
public fun shouldResumeWithValidCode() {
90-
par(account)
90+
authorizeWithPAR(account)
9191
.start(activity, REQUEST_URI, callback)
9292

9393
verify(activity).startActivity(intentCaptor.capture())
@@ -105,7 +105,7 @@ public class PARCodeManagerTest {
105105

106106
@Test
107107
public fun shouldFailWithMissingCode() {
108-
par(account)
108+
authorizeWithPAR(account)
109109
.start(activity, REQUEST_URI, callback)
110110

111111
verify(activity).startActivity(intentCaptor.capture())
@@ -123,7 +123,7 @@ public class PARCodeManagerTest {
123123

124124
@Test
125125
public fun shouldFailWithErrorResponse() {
126-
par(account)
126+
authorizeWithPAR(account)
127127
.start(activity, REQUEST_URI, callback)
128128

129129
verify(activity).startActivity(intentCaptor.capture())
@@ -141,7 +141,7 @@ public class PARCodeManagerTest {
141141

142142
@Test
143143
public fun shouldHandleCanceledAuthentication() {
144-
par(account)
144+
authorizeWithPAR(account)
145145
.start(activity, REQUEST_URI, callback)
146146

147147
verify(activity).startActivity(intentCaptor.capture())
@@ -167,7 +167,7 @@ public class PARCodeManagerTest {
167167
null
168168
)
169169

170-
par(account)
170+
authorizeWithPAR(account)
171171
.start(activity, REQUEST_URI, callback)
172172

173173
verify(callback).onFailure(authExceptionCaptor.capture())

0 commit comments

Comments
 (0)