Hi, Can anyone help on give me a Google OAuth2 login working example? only email address is required.
I tried with multi_auth shard, but failed with a message:
The caller does not have permission to request “people/me”. Request requires one of the following scopes: [profile].
backtrace:
GET /multi_auth/google/callback?code=4%2F0AVMBsJjvssA-eqjJQ-8EXtIeOy23ZmYMe4Iid9q4loqw7L1JL8KHVnHZn_Q-yTxEYxwpXQ&scope=email+openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&authuser=0&prompt=none
▸ MultiAuth::Exception
The caller does not have permission to request "people/me". Request requires one of the following scopes: [profile].
Backtrace
lib/multi_auth/src/multi_auth/providers/google.cr:87:15 in 'build_user'
lib/multi_auth/src/multi_auth/providers/google.cr:59:5 in 'user'
lib/multi_auth/src/multi_auth/engine.cr:30:5 in 'user'
/src/actions/sign_ups/oauth/callback.cr:4:3 in 'action_call_body'
/src/actions/sign_ups/oauth/callback.cr:4:3 in 'call'
lib/lucky/src/lucky/renderable.cr:130:16 in 'perform_action'
lib/lucky/src/lucky/route_handler.cr:10:7 in 'call'
Crystal/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'
lib/lucky/src/lucky/remote_ip_handler.cr:26:5 in 'call'
Crystal/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'
lib/lucky/src/lucky/error_handler.cr:15:5 in 'call'
Crystal/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'
lib/lucky/src/lucky/log_handler.cr:34:9 in 'call'
Crystal/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'
lib/lucky/src/lucky/http_method_override_handler.cr:11:5 in 'call'
Crystal/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'
lib/lucky/src/lucky/force_ssl_handler.cr:37:7 in 'call'
Crystal/share/crystal/src/http/server/handler.cr:30:7 in 'call_next'
lib/lucky/src/lucky/request_id_handler.cr:24:5 in 'call'
Crystal/share/crystal/src/http/server/request_processor.cr:51:11 in 'process'
Crystal/share/crystal/src/http/server.cr:521:5 in 'handle_client'
Crystal/share/crystal/src/http/server.cr:451:5 in '->'
Crystal/share/crystal/src/fiber.cr:170:11 in 'run'
Crystal/share/crystal/src/fiber.cr:105:3 in '->'
When doing a request to an OAuth-protected resource you can specify any number of scopes (separated by a space). That is in the OAuth standard: RFC 6749: The OAuth 2.0 Authorization Framework