Smart Lock for Passwords
Somkiat Khitwongwattana
Android Developer@Nextzy & Android GDE & Contributor@Droidsans
Smart Lock for Passwords
Smart Lock
• Signed-in across devices
• For Android and Chrome
• Reduce the risk of forgotten
Smart Lock for Passwords
Credentials API
• Retrieve and save app login credentials
• Auth.CREDENTIALS_API
• Multiple user credentials supported
Smart Lock for Passwords
Credential Management Capability
• Username
• Name
• Password
• Profile Picture URL
• Account Type
Smart Lock for Passwords
Smart Lock Flow
• Auto sign-in
• Multiple credentials
• No credentials / Signed out
• App start • Signed in
Smart Lock for Passwords
Smart Lock Flow
Smart Lock for Passwords
No credentials / Signed out
Smart Lock for Passwords
Auto sign-in
Smart Lock for Passwords
Multiple credentials
Smart Lock for Passwords
Get Started
• Add Google Play Services dependency
compile  'com.google.android.gms:play-­‐services:7.8.0'
• Declare the version of Google Play services
<application>  
   ...  
   <meta-­‐data  android:name="com.google.android.gms.version"  
                         android:value="@integer/google_play_services_version"  />  
   ...  
</application>
Smart Lock for Passwords
Get Started
• Create an OAuth 2.0 client ID
• Open Google Developer Console
• Create project
Smart Lock for Passwords
Get Started
• Setup OAuth consent screen
Smart Lock for Passwords
Get Started
• Create client ID
Smart Lock for Passwords
Get Started• Setup client ID
Smart Lock for Passwords
Get Started
• Example client ID
478989446966-gdahdsjn77selo6f1rnab6e2pd1nq4f3.apps.googleusercontent.com
Smart Lock for Passwords
Let's Get Coding
GoogleApiClient  mCredentialsApiClient;  
...  
mCredentialsApiClient  =  new  GoogleApiClient.Builder(this)  
      .addConnectionCallbacks(this)  
      .enableAutoManage(this,  0,  this)  
      .addApi(Auth.CREDENTIALS_API)  
      .build();
Smart Lock for Passwords
Store Credentials
Credential  credential  =  new  Credential.Builder(username)  
      .setPassword(password)  
      .setAccountType(accountType)  
      .setName(name)  
      .setProfilePictureUri(url)  
      .build();
Smart Lock for Passwords
Store Credentials
Auth.CredentialsApi.save(mCredentialsApiClient,  credential)

                .setResultCallback(new  ResultCallback<Status>()  {  
        @Override  
        public  void  onResult(Status  status)  {  
                ...  
        }  
});
Smart Lock for Passwords
Store Credentials
int  REQUEST_CODE_SAVE  =  123;  
Status  status  =  result.getStatus();  
if(status.isSuccess())  {  
        ...  
}  else  {  
        if(status.hasResolution())  {  
                status.startResolutionForResult(this,  REQUEST_CODE_SAVE);  
        }  else  {  
                ...  
        }  
}
Smart Lock for Passwords
Store Credentials
Smart Lock for Passwords
Store Credentials
@Override  
public  void  onActivityResult(int  requestCode,  int  resultCode,  Intent  data)  {  
        ...  
        if  (requestCode  ==  REQUEST_CODE_SAVE)  {  
                if  (resultCode  ==  RESULT_OK)  {  
                        ...  
                }  else  {  
                        ...  
                }  
        }  
        ...  
}
Smart Lock for Passwords
Request Credentials
CredentialRequest  request  =  new  CredentialRequest.Builder()  
                .setSupportsPasswordLogin(true)  
                .build();
Smart Lock for Passwords
Request Credentials
Auth.CredentialsApi.request(mCredentialsApiClient,  request)  
                .setResultCallback(new  ResultCallback<CredentialRequestResult>()  {  
        @Override  
        public  void  onResult(CredentialRequestResult  credentialRequestResult)  {  
                ...  
        }  
});
Smart Lock for Passwords
Share Credentials with Apps and Sites
• Verify website's sign-in domain by using the Google Search Console
• Make an association to Play Developer Console
• Must be available through HTTPS
Smart Lock for Passwords
Share Credentials with Apps and Sites
Smart Lock for Passwords
Share Credentials with Apps and Sites
Smart Lock for Passwords
Reference
https://developers.google.com/identity/smartlock-passwords
https://www.youtube.com/watch?v=M3Udfu6qidk
Smart Lock for Passwords Documentation
Google Play Services 7.5 (100 Days of Google Dev)

More Related Content

PPTX
User Authentication and Cloud Authorization in the Galaxy project: https://do...
PPTX
Sfdc tournyc14 salesforceintegrationwithgoogledoubleclick__final_20141119
PPTX
An Introduction to OAuth2
PDF
OAuth 2.0
PDF
Stateless authentication with OAuth 2 and JWT - JavaZone 2015
PDF
From 0 to Spring Security 4.0
PDF
ConFoo 2015 - Securing RESTful resources with OAuth2
PDF
Protecting web APIs with OAuth 2.0
User Authentication and Cloud Authorization in the Galaxy project: https://do...
Sfdc tournyc14 salesforceintegrationwithgoogledoubleclick__final_20141119
An Introduction to OAuth2
OAuth 2.0
Stateless authentication with OAuth 2 and JWT - JavaZone 2015
From 0 to Spring Security 4.0
ConFoo 2015 - Securing RESTful resources with OAuth2
Protecting web APIs with OAuth 2.0

What's hot (20)

PDF
Stateless Auth using OAuth2 & JWT
PPTX
Securing RESTful APIs using OAuth 2 and OpenID Connect
PPTX
Single-Page-Application & REST security
PDF
CIS14: OAuth and OpenID Connect in Action
PPTX
Oauth 2.0 security
PDF
Demystifying OAuth 2.0
PDF
Modern Security with OAuth 2.0 and JWT and Spring by Dmitry Buzdin
PPT
OAuth2 Protocol with Grails Spring Security
PDF
Stateless authentication for microservices - GR8Conf 2015
PDF
OAuth2 and Spring Security
PDF
Stateless authentication for microservices
PPTX
Securing your APIs with OAuth, OpenID, and OpenID Connect
PPTX
OAuth2 & OpenID Connect
PDF
JavaOne 2014 - Securing RESTful Resources with OAuth2
PPTX
.NET Fest 2017. Михаил Щербаков. Механизмы предотвращения атак в ASP.NET Core
PDF
CIS14: Working with OAuth and OpenID Connect
PDF
Stateless authentication for microservices - Greach 2015
PPTX
REST Service Authetication with TLS & JWTs
PPTX
Securing RESTful Payment APIs Using OAuth 2
PPTX
Aspnet 4 new features
Stateless Auth using OAuth2 & JWT
Securing RESTful APIs using OAuth 2 and OpenID Connect
Single-Page-Application & REST security
CIS14: OAuth and OpenID Connect in Action
Oauth 2.0 security
Demystifying OAuth 2.0
Modern Security with OAuth 2.0 and JWT and Spring by Dmitry Buzdin
OAuth2 Protocol with Grails Spring Security
Stateless authentication for microservices - GR8Conf 2015
OAuth2 and Spring Security
Stateless authentication for microservices
Securing your APIs with OAuth, OpenID, and OpenID Connect
OAuth2 & OpenID Connect
JavaOne 2014 - Securing RESTful Resources with OAuth2
.NET Fest 2017. Михаил Щербаков. Механизмы предотвращения атак в ASP.NET Core
CIS14: Working with OAuth and OpenID Connect
Stateless authentication for microservices - Greach 2015
REST Service Authetication with TLS & JWTs
Securing RESTful Payment APIs Using OAuth 2
Aspnet 4 new features
Ad

Viewers also liked (14)

PDF
Advance Android Layout Walkthrough
PPT
Smart Lock Systems
PDF
Infinum Android Talks #03 - Android Design Best Practices - for Designers and...
PDF
Chapter 10 - Views Part 2
PDF
What's new in Google Play Services @ I/O Rewind Bangkok
PDF
Whats new in Android Development Tools @ I/O Rewind Bangkok
PPTX
Interface Design for Mobile Application
PDF
Deep dive into android restoration - DroidCon Paris 2014
PDF
Advanced iOS
PPTX
Smart door lock
PDF
Pokemon GO 101@Nextzy
PPTX
Introduction to Listview in Android
PPTX
ListView and Custom ListView on Android Development [Thai]
PDF
Prenetics InsurTech Award Presentation
Advance Android Layout Walkthrough
Smart Lock Systems
Infinum Android Talks #03 - Android Design Best Practices - for Designers and...
Chapter 10 - Views Part 2
What's new in Google Play Services @ I/O Rewind Bangkok
Whats new in Android Development Tools @ I/O Rewind Bangkok
Interface Design for Mobile Application
Deep dive into android restoration - DroidCon Paris 2014
Advanced iOS
Smart door lock
Pokemon GO 101@Nextzy
Introduction to Listview in Android
ListView and Custom ListView on Android Development [Thai]
Prenetics InsurTech Award Presentation
Ad

More from Somkiat Khitwongwattana (12)

PPTX
What's new in Android - Google I/O Extended Bangkok 2022
PDF
Canvas API in Android
PDF
Get Ready for Target SDK Version 29 and 30
PDF
What's new in Android P @ I/O Extended Bangkok 2018
PDF
New things that android developer should not miss in 2019
PDF
Architecture Components In Real Life Season 2
PDF
Bitmap management like a boss
PDF
Android Architecture Component in Real Life
PDF
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
PDF
Deep Dive Into Repository - Android Architecture Components
PDF
Introduction to Architecture Components @ Google I/O Extended Bangkok 2017
PDF
What's new in Android O @ Google I/O Extended Bangkok 2017
What's new in Android - Google I/O Extended Bangkok 2022
Canvas API in Android
Get Ready for Target SDK Version 29 and 30
What's new in Android P @ I/O Extended Bangkok 2018
New things that android developer should not miss in 2019
Architecture Components In Real Life Season 2
Bitmap management like a boss
Android Architecture Component in Real Life
Hello, Android Studio 3.2 & Android App Bundle @ I/O Extended Bangkok 2018
Deep Dive Into Repository - Android Architecture Components
Introduction to Architecture Components @ Google I/O Extended Bangkok 2017
What's new in Android O @ Google I/O Extended Bangkok 2017

Recently uploaded (20)

PDF
How IoT Sensor Integration in 2025 is Transforming Industries Worldwide
PPTX
Custom Battery Pack Design Considerations for Performance and Safety
PDF
Consumable AI The What, Why & How for Small Teams.pdf
PPTX
Configure Apache Mutual Authentication
PDF
Accessing-Finance-in-Jordan-MENA 2024 2025.pdf
PPTX
TEXTILE technology diploma scope and career opportunities
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PDF
A proposed approach for plagiarism detection in Myanmar Unicode text
PDF
UiPath Agentic Automation session 1: RPA to Agents
PDF
Convolutional neural network based encoder-decoder for efficient real-time ob...
PDF
STKI Israel Market Study 2025 version august
PDF
Produktkatalog für HOBO Datenlogger, Wetterstationen, Sensoren, Software und ...
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PPTX
The various Industrial Revolutions .pptx
PPT
What is a Computer? Input Devices /output devices
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PDF
Improvisation in detection of pomegranate leaf disease using transfer learni...
PDF
Zenith AI: Advanced Artificial Intelligence
PPTX
Microsoft Excel 365/2024 Beginner's training
How IoT Sensor Integration in 2025 is Transforming Industries Worldwide
Custom Battery Pack Design Considerations for Performance and Safety
Consumable AI The What, Why & How for Small Teams.pdf
Configure Apache Mutual Authentication
Accessing-Finance-in-Jordan-MENA 2024 2025.pdf
TEXTILE technology diploma scope and career opportunities
Taming the Chaos: How to Turn Unstructured Data into Decisions
NewMind AI Weekly Chronicles – August ’25 Week III
A proposed approach for plagiarism detection in Myanmar Unicode text
UiPath Agentic Automation session 1: RPA to Agents
Convolutional neural network based encoder-decoder for efficient real-time ob...
STKI Israel Market Study 2025 version august
Produktkatalog für HOBO Datenlogger, Wetterstationen, Sensoren, Software und ...
Final SEM Unit 1 for mit wpu at pune .pptx
The various Industrial Revolutions .pptx
What is a Computer? Input Devices /output devices
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
Improvisation in detection of pomegranate leaf disease using transfer learni...
Zenith AI: Advanced Artificial Intelligence
Microsoft Excel 365/2024 Beginner's training

Smart Lock for Password @ Game DevFest Bangkok 2015

  • 1. Smart Lock for Passwords Somkiat Khitwongwattana Android Developer@Nextzy & Android GDE & Contributor@Droidsans
  • 2. Smart Lock for Passwords Smart Lock • Signed-in across devices • For Android and Chrome • Reduce the risk of forgotten
  • 3. Smart Lock for Passwords Credentials API • Retrieve and save app login credentials • Auth.CREDENTIALS_API • Multiple user credentials supported
  • 4. Smart Lock for Passwords Credential Management Capability • Username • Name • Password • Profile Picture URL • Account Type
  • 5. Smart Lock for Passwords Smart Lock Flow • Auto sign-in • Multiple credentials • No credentials / Signed out • App start • Signed in
  • 6. Smart Lock for Passwords Smart Lock Flow
  • 7. Smart Lock for Passwords No credentials / Signed out
  • 8. Smart Lock for Passwords Auto sign-in
  • 9. Smart Lock for Passwords Multiple credentials
  • 10. Smart Lock for Passwords Get Started • Add Google Play Services dependency compile  'com.google.android.gms:play-­‐services:7.8.0' • Declare the version of Google Play services <application>     ...     <meta-­‐data  android:name="com.google.android.gms.version"                          android:value="@integer/google_play_services_version"  />     ...   </application>
  • 11. Smart Lock for Passwords Get Started • Create an OAuth 2.0 client ID • Open Google Developer Console • Create project
  • 12. Smart Lock for Passwords Get Started • Setup OAuth consent screen
  • 13. Smart Lock for Passwords Get Started • Create client ID
  • 14. Smart Lock for Passwords Get Started• Setup client ID
  • 15. Smart Lock for Passwords Get Started • Example client ID 478989446966-gdahdsjn77selo6f1rnab6e2pd1nq4f3.apps.googleusercontent.com
  • 16. Smart Lock for Passwords Let's Get Coding GoogleApiClient  mCredentialsApiClient;   ...   mCredentialsApiClient  =  new  GoogleApiClient.Builder(this)       .addConnectionCallbacks(this)       .enableAutoManage(this,  0,  this)       .addApi(Auth.CREDENTIALS_API)       .build();
  • 17. Smart Lock for Passwords Store Credentials Credential  credential  =  new  Credential.Builder(username)       .setPassword(password)       .setAccountType(accountType)       .setName(name)       .setProfilePictureUri(url)       .build();
  • 18. Smart Lock for Passwords Store Credentials Auth.CredentialsApi.save(mCredentialsApiClient,  credential)
                .setResultCallback(new  ResultCallback<Status>()  {          @Override          public  void  onResult(Status  status)  {                  ...          }   });
  • 19. Smart Lock for Passwords Store Credentials int  REQUEST_CODE_SAVE  =  123;   Status  status  =  result.getStatus();   if(status.isSuccess())  {          ...   }  else  {          if(status.hasResolution())  {                  status.startResolutionForResult(this,  REQUEST_CODE_SAVE);          }  else  {                  ...          }   }
  • 20. Smart Lock for Passwords Store Credentials
  • 21. Smart Lock for Passwords Store Credentials @Override   public  void  onActivityResult(int  requestCode,  int  resultCode,  Intent  data)  {          ...          if  (requestCode  ==  REQUEST_CODE_SAVE)  {                  if  (resultCode  ==  RESULT_OK)  {                          ...                  }  else  {                          ...                  }          }          ...   }
  • 22. Smart Lock for Passwords Request Credentials CredentialRequest  request  =  new  CredentialRequest.Builder()                  .setSupportsPasswordLogin(true)                  .build();
  • 23. Smart Lock for Passwords Request Credentials Auth.CredentialsApi.request(mCredentialsApiClient,  request)                  .setResultCallback(new  ResultCallback<CredentialRequestResult>()  {          @Override          public  void  onResult(CredentialRequestResult  credentialRequestResult)  {                  ...          }   });
  • 24. Smart Lock for Passwords Share Credentials with Apps and Sites • Verify website's sign-in domain by using the Google Search Console • Make an association to Play Developer Console • Must be available through HTTPS
  • 25. Smart Lock for Passwords Share Credentials with Apps and Sites
  • 26. Smart Lock for Passwords Share Credentials with Apps and Sites
  • 27. Smart Lock for Passwords Reference https://developers.google.com/identity/smartlock-passwords https://www.youtube.com/watch?v=M3Udfu6qidk Smart Lock for Passwords Documentation Google Play Services 7.5 (100 Days of Google Dev)