Comments (15)
This page might be useful for converting the authData
between a String
and a Map
https://docs.flutter.dev/data-and-backend/serialization/json
from solidpod.
So Anushka mentioned that re-creating the client
instance can be done through:
var client = Client(issuer, _clientId, clientSecret: _clientSecret);
where both the _clientId
and _clientSecret
are strings (so can be serialised).
The issuer
variable can be recreated through:
Issuer issuer = await Issuer.discover(issuerUri);
where issuerUri
is the same as the one when calling the authenticate
function.
Therefore, it seems that we should be able to recreate the client
instance by saving the _clientId
, _clientSecret
and issuerUri
.
from solidpod.
So Anushka mentioned that re-creating the
client
instance can be done through:var client = Client(issuer, _clientId, clientSecret: _clientSecret);
where both the
_clientId
and_clientSecret
are strings (so can be serialised). Theissuer
variable can be recreated through:Issuer issuer = await Issuer.discover(issuerUri);
where
issuerUri
is the same as the one when calling theauthenticate
function.Therefore, it seems that we should be able to recreate the
client
instance by saving the_clientId
,_clientSecret
andissuerUri
.
Thanks @cdawei on it
from solidpod.
Could this be assigned to Kevin? Start to have a look at how this will work. Thanks.
from solidpod.
Assign myself to this ticket
from solidpod.
https://github.com/anusii/solidpod/tree/kev/3_popup
working branch
from solidpod.
![image](https://private-user-images.githubusercontent.com/37771259/308741134-597a7a2f-fdbe-4947-a2dd-1a950bc30a4f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE3MTk1MjAsIm5iZiI6MTcyMTcxOTIyMCwicGF0aCI6Ii8zNzc3MTI1OS8zMDg3NDExMzQtNTk3YTdhMmYtZmRiZS00OTQ3LWEyZGQtMWE5NTBiYzMwYTRmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcm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BkL6LYY)
![image](https://private-user-images.githubusercontent.com/37771259/308741444-bb0d46c2-9c44-4e10-a777-c85d0282c39f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE3MTk1MjAsIm5iZiI6MTcyMTcxOTIyMCwicGF0aCI6Ii8zNzc3MTI1OS8zMDg3NDE0NDQtYmIwZDQ2YzItOWM0NC00ZTEwLWE3NzctYzg1ZDAyODJjMzlmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzIzVDA3MjAyMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk3NjM3ZGYxOGMwNWE4ZWU5YjkwMzQ4MzY0ZTA0ZjU2MmIwNTZhMGM1NGMyMjlkMzAyYzcwZGJmZDAxYzQ0MzUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.5NekkjblRPobEKJi-8FTf3P7-pDBSE4NaHhqEVqbcGo)
from solidpod.
solidpod repo:
#57
keypod repo:
anusii/keypod#51
PR created
from solidpod.
in progress, working on saving auth data/token for use on other pages as in SolidLogin()
from solidpod.
I converted authdata (Map format) into String using serializeMap so that we can save them in secureStorage. But I found difficulty converting the string back to the correct map format. Dawei suggested I can convert the map into Json format first, then save as a string using secureStorage.
from solidpod.
/// Store authentication data
authData = {
'client': client,
'rsaInfo': rsaResults,
'authResponse': authResponse,
'tokenResponse': tokenResponse,
'accessToken': accessToken,
'idToken': tokenResponse.idToken,
'refreshToken': tokenResponse.refreshToken,
'expiresIn': tokenResponse.expiresIn,
'logoutUrl': _logoutUrl
};
how to Serialize JSON for each map value .
error I got: Converting object to an encodable object failed: Instance of 'Clientโ
from solidpod.
demo video:
![image](https://private-user-images.githubusercontent.com/37771259/313532217-379cdea3-6731-48ca-8004-1ade448f853a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE3MTk1MjAsIm5iZiI6MTcyMTcxOTIyMCwicGF0aCI6Ii8zNzc3MTI1OS8zMTM1MzIyMTctMzc5Y2RlYTMtNjczMS00OGNhLTgwMDQtMWFkZTQ0OGY4NTNhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzIzVDA3MjAyMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJhYmI4NjY3NDU5MmZiYmRiNGY2Mzg3NTkxMmJjMGRjMWVjOGRjNWZjYWU0YTljNDZmM2IzMjQ3NjI1MTkyNDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.iZ21TrI6JJK-EH0yxAsdOCT9KN50V2U6LCg4PasYqEo)
video1107929422.mp4
from solidpod.
// Get the authentication data from the secure storage.
const storage =
FlutterSecureStorage();
String? jsonAuthData = await storage
.read(key: 'authData');
Map<String, dynamic> deserializedMap =
json.decode(jsonAuthData!);
var rsaInfo =
deserializedMap['rsaInfo'];
KeyPair deserializedKeyPair = KeyPair(
rsaInfo['rsa']['publicKey'],
rsaInfo['rsa']['privateKey'],
);
var pubKeyJwk = rsaInfo['pubKeyJwk'];
Map<String, dynamic> authData = {
'accessToken':
deserializedMap['accessToken'],
'rsaInfo': {
'rsa': deserializedKeyPair,
'pubKeyJwk': pubKeyJwk,
},
};
![image](https://private-user-images.githubusercontent.com/37771259/313532463-18c8f9bc-eea1-4f50-8b6c-e568373a3e2c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE3MTk1MjAsIm5iZiI6MTcyMTcxOTIyMCwicGF0aCI6Ii8zNzc3MTI1OS8zMTM1MzI0NjMtMThjOGY5YmMtZWVhMS00ZjUwLThiNmMtZTU2ODM3M2EzZTJjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzIzVDA3MjAyMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThiMmYxYzY0OTBkYzlkMWYyOTJkY2UzNzM2ZmRmMGU2YTA3YWE3ZmFkMDA0NDVlOWZlNGM1MDIyMDNkZDFjZjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.lCguJlI4zEwihcgqznMDZboTcDXwCnTnndo9yOscsXM)
from solidpod.
https://github.com/anusii/bstim/pull/364
PR created
from solidpod.
Let's review this today - that it is fully functional.
from solidpod.
Related Issues (20)
- RDF: Ontology for customised predicates HOT 1
- SOLID POD: Read and write binary data HOT 3
- SECURITY: Ok for `keypod` to access data of `podnotes` in the same POD?
- RDF vs JSON: Which format to use in POD apps
- PERMISSION: Allow only `Append` to recipient's shared resource list
- SOLID POD: Are secret keys per app or per pod? HOT 1
- POD: create UI to manage resources in POD HOT 1
- PERMISSION: Add permission log entries HOT 1
- PERMISSION: File browser for granting permissions HOT 1
- PERMISSION: View permissions given to a user HOT 1
- PERMISSION: Migrating permission example page from KeyPod to Solidpod example app HOT 1
- PERMISSION: Modify `Grant permission` function to handle public and group permissions
- SOLIDPOD: Migrate to DelayedTooltip
- SOLID POD: Use DelayedTooltip for the login buttons
- SOLIDPOD: How to use state management in terms of code refactoring HOT 2
- PERMISSION: Revoking new permissions
- KEYPOD: Allow viewing other person's KeyPod data and display WebID on the Editor feature too
- SOLID POD: Large file management HOT 1
- SOLID SERVER: Lock expired when creating large file
- SOLID POD: Release 1.0.0 HOT 1
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 solidpod.