Comments (6)
Hi @hantsy . Thanks for using FusionAuth!
The username in the registration is for display purposes only. From the [registrations documentation[(https://fusionauth.io/docs/v1/tech/apis/registrations), registration.username
.
The username of the User for this Application. This username cannot be used to login. It is for display purposes only. The user.username field may be used to login.
So this field lets you have users with different display names in different applications (mooreds in a forum, dan.moore in a support ticket system, etc).
Hope that clears this up. I'm going to close out this issue.
from fusionauth-java-client.
Currently I used username
of UserRegistratoin
and call the client register
method to register a new user. Not for display.
What confused me it the user registration request spec contains this field, and I have set it, but it is not applied when calling register
.
from fusionauth-java-client.
So this field lets you have users with different display names in different applications (mooreds in a forum, dan.moore in a support ticket system, etc).
Currently these fields are part of the request object spec, and they can be set freely, but did not work as expected.
For each endpoints, every field of the request object should be affected if assigning a value.
from fusionauth-java-client.
For each endpoints, every field of the request object should be affected if assigning a value.
I'm not sure I understand the issue. Can you please share some code snippets?
from fusionauth-java-client.
I see some code snippets above, but I'm not clear on which username is not stored if you uncomment username
in UserRegistration
. Is there a value on user.username
, user.registration.username
, both or none?
from fusionauth-java-client.
So I just tried to replicate with this code:
package io.fusionauth.example;
import java.util.UUID;
import com.inversoft.error.Errors;
import io.fusionauth.client.FusionAuthClient;
import io.fusionauth.domain.User;
import io.fusionauth.domain.UserRegistration;
import io.fusionauth.domain.api.user.RegistrationRequest;
import io.fusionauth.domain.api.user.RegistrationResponse;
import com.inversoft.rest.ClientResponse;
import java.util.*;
public class RegisterUser {
public static void main(String[] args) {
ApplicationProperties.setupProperties();
// Initiating the client
FusionAuthClient client = new FusionAuthClient(ApplicationProperties.getApiKey(),
ApplicationProperties.getFusionAuthURL());
// Initiating the user and providing registration details
User javauser = new User();
javauser.email = "[email protected]";
javauser.password = "password";
javauser.lastName = "last";
javauser.firstName = "first";
javauser.username = "username3";
// Initiating user registration and creating request object
UserRegistration userreg = new UserRegistration();
userreg.applicationId = UUID.fromString("20ce6dac-b985-4c77-bb59-6369249f884b");
SortedSet<String> roles = new TreeSet<String>();
roles.add("ADMIN");
userreg.roles = roles;
userreg.username = "regusername3";
RegistrationRequest request = new RegistrationRequest(javauser, userreg);
// Using the returned ClientResponse object
ClientResponse<RegistrationResponse, Errors> response = client.register(null, request);
if (response.wasSuccessful()) {
System.out.println("Registration successful");
} else {
// Handling errors
System.out.println(response.errorResponse);
}
}
}
And I was able to provide the username on the user object as well as on the registration object.
I'm going to close this since I can't reproduce. Please re-open if you can provide replication steps or if I misunderstand the issue.
from fusionauth-java-client.
Related Issues (11)
- Getting socket failed: EACCES (Permission denied) HOT 1
- Search users using database search engine ? HOT 4
- Java 7 / Android client support HOT 6
- Create user does not set roles HOT 5
- Maven central out of sync with releases and dependencies HOT 2
- failed to retrieve Public Keys by `retrieveJWTPublicKeyByApplicationId` HOT 4
- Publish 1.41.3 to Maven Central HOT 1
- couldn't create RSA key HOT 1
- Ability to create Application level API Key HOT 1
- Create User -> Update User -> Not Found in Elasticsearch query HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fusionauth-java-client.