File tree Expand file tree Collapse file tree 3 files changed +35
-2
lines changed
main/java/com/google/firebase/auth
test/java/com/google/firebase/auth Expand file tree Collapse file tree 3 files changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -102,9 +102,9 @@ public T setDisplayName(String displayName) {
102
102
*
103
103
* @param enabled a boolean indicating whether the user can sign in with the provider
104
104
*/
105
- public T setEnabled (boolean enabled ) {
105
+ public CreateRequest setEnabled (boolean enabled ) {
106
106
properties .put ("enabled" , enabled );
107
- return getThis () ;
107
+ return this ;
108
108
}
109
109
110
110
Map <String , Object > getProperties () {
Original file line number Diff line number Diff line change 21
21
import com .google .api .client .util .Key ;
22
22
import com .google .common .base .Strings ;
23
23
import com .google .common .collect .ImmutableMap ;
24
+ import java .net .MalformedURLException ;
25
+ import java .net .URL ;
24
26
import java .util .HashMap ;
25
27
import java .util .Map ;
26
28
@@ -80,6 +82,11 @@ public CreateRequest setClientId(String clientId) {
80
82
*/
81
83
public CreateRequest setIssuer (String issuer ) {
82
84
checkArgument (!Strings .isNullOrEmpty (issuer ), "issuer must not be null or empty" );
85
+ try {
86
+ new URL (issuer );
87
+ } catch (MalformedURLException e ) {
88
+ throw new IllegalArgumentException (issuer + " is a malformed URL" , e );
89
+ }
83
90
properties .put ("issuer" , issuer );
84
91
return this ;
85
92
}
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2020 Google LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ package com .google .firebase .auth ;
18
+
19
+ import org .junit .Test ;
20
+
21
+ public class OidcProviderConfigTest {
22
+ @ Test (expected = IllegalArgumentException .class )
23
+ public void testInvalidIssuerUrl () {
24
+ new OidcProviderConfig .CreateRequest ().setIssuer ("not a valid url" );
25
+ }
26
+ }
You can’t perform that action at this time.
0 commit comments