The session-token is created after successful login and is provided to you by CorbadoAuth through userChanges. We can access it through the userProvider we created in the previous Overview step.

For more information on session-token handling, we highly recommend consulting our documentation.

Here is a brief example of how to include the session-token in your requests to your backend (e.g. https://www.corbado.com):

lib/pages/edit_profile_page.dart
// This is only an example for demonstrations purposes
    Future<void> makeRequest() async {
      final url = Uri.parse('https://www.corbado.com');
 
      final response = await http.get(
        url,
        headers: {
          'Authorization': 'Bearer ${user.value!.idToken}',
          'Content-Type': 'application/json',
        },
      );
    }